Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Synthetics Tests #169

Merged
merged 22 commits into from
Apr 15, 2019
Merged

Support Synthetics Tests #169

merged 22 commits into from
Apr 15, 2019

Conversation

gabsn
Copy link
Contributor

@gabsn gabsn commented Apr 5, 2019

This PR will add support for CRUD operations on API Synthetics Tests.

We need to wait for this PR to be merged before merging this one.

TODO

  • support for API tests
  • support for Browser tests (step creation not included)
  • support for import
  • update TFP doc

Testing guidelines

Either run make testacc to run acceptance tests or try the CLI tool:

# In terraform-provider-datadog
make build
cp ~/go/bin/terraform-provider-datadog ~/.terraform.d/plugins/

# In your infra repo
terraform init
terraform apply

With a basic main.tf terraform config file:

# Configure the Datadog provider
provider "datadog" {
  api_key = "XXX"
  app_key = "XXX"
}

resource "datadog_synthetics_test" "foo" {
  type = "api"

  request {
	  method = "GET"
	  url = "https://docs.datadoghq.com"
  }
  assertions = [
    {
      type = "statusCode"
      operator = "is"
      target = "200"
  	},
    {
      type = "responseTime"
      operator = "lessThan"
      target = "2000"
  	}
  ]

  locations = [ "aws:eu-central-1", "aws:ap-northeast-1" ]
  options {
	tick_every = 60
  }

  name = "name for synthetics test foo"
  message = "Notify @datadog.user"
  tags = ["foo:bar", "baz"]

  paused = true
}

go.mod Outdated Show resolved Hide resolved
@gabsn gabsn changed the title Support API Synthetics Tests Support Synthetics Tests Apr 8, 2019
@gzussa
Copy link
Contributor

gzussa commented Apr 11, 2019

Let's update the API Go Client upstream.

Copy link
Contributor

@gzussa gzussa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

@ghost ghost added the documentation label Apr 12, 2019
Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks real good, I just have couple minor notes inline that should be addressed/answered. Please also consider squashing the commits. Thanks!

datadog/resource_datadog_synthetics_test_.go Outdated Show resolved Hide resolved
datadog/resource_datadog_synthetics_test_.go Outdated Show resolved Hide resolved
datadog/resource_datadog_synthetics_test_.go Outdated Show resolved Hide resolved
@bkabrda
Copy link
Contributor

bkabrda commented Apr 15, 2019

LGTM 👍. Code is ok, acceptance tests are green and some hand testing with TF also looks good. (I don't have rights to merge though, so someone else needs to push the button)

@nmuesch nmuesch merged commit 845267e into DataDog:master Apr 15, 2019
jbenais pushed a commit to jbenais/terraform-provider-datadog that referenced this pull request Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants