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

Authentication for datadog_synthetics_tests #305

Closed
tomasaberg opened this issue Aug 28, 2019 · 2 comments · Fixed by #586
Closed

Authentication for datadog_synthetics_tests #305

tomasaberg opened this issue Aug 28, 2019 · 2 comments · Fixed by #586

Comments

@tomasaberg
Copy link

Hi!

Terraform Version

Terraform v0.12.7

  • provider.datadog v2.0.2

Affected Resource(s)

  • datadog_synthetics_test

Terraform Configuration Files

(Some parts are masked)

# Create a new DataDog Synthetics API test on https://www.aftonbladet.se
resource "datadog_synthetics_test" "example_herokuapp_com" {
  type = "api"
  request = {
    method = "GET"
    url = "http://example.herokuapp.com/"
    timeout = "30"
  }

  assertions = [
   {
      "operator" = "lessThan"
      "target"   = "200"
      "type"     = "responseTime"
   },
   {
      "operator" = "is"
      "target"   = "200"
      "type"     = "statusCode"
   }
  ]

  locations = [
    "aws:eu-central-1",
    "aws:eu-west-2",
    "aws:eu-west-1"
  ]

  request_headers = {
    Authentication = "Basic: udGVudk0xY"
  }

  options = {
    min_failure_duration = 120
    min_location_failed  = 1
    tick_every           = 60
  }

  name = "example.herokuapp.com"
  message = "{{#is_alert}}Check failed! Click for more information! @slack***{{/is_alert}}{{#is_recovery}}Check recovered! @slack***{{/is_recovery}}"
  tags    = [
    "Managed by Terraform",
    "HTTP"
  ]

  status = "live"

}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.
N/A

Expected Behavior

What should have happened?
Updated the "Http basic auth" part in DataDog

Actual Behavior

What actually happened?
Updated header

Thoughts

I understand that the request_headers update the headers part.
My issue is rather a question. Is it possible to use terraform for updating the basic http auth (see attachment)?

dd

The terraform example for auth that I can find is by using request_headers, but I cant get it to work. I have manually added username and password in the Authentication tab in DataDog, then the test works but terraform won't recognise the changes I made.

@tomasaberg
Copy link
Author

Got it to work, I had a error in by auth string.
But my question is still valid. Is it possible to use the http basic auth instead?
I think one difference is that the password gets masked when using that box.

@dabcoder
Copy link
Contributor

Apologies for the delay in updating this thread.

Is it possible to use the http basic auth instead?

Not at this point I am afraid, it would be a feature to add to the provider at this point and we do not have any ETA for that right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants