terraform-provider-datadog icon indicating copy to clipboard operation
terraform-provider-datadog copied to clipboard

datadog_webhook fails to create webhook

Open jajera opened this issue 4 months ago • 0 comments

Datadog Terraform Provider Version

v3.43.1

Terraform Version

v1.9.7

What resources or data sources are affected?

datadog_webhook

There is no naming convention and it accepts values that can fail. An example is if you create a webhook with spaces, its not validated and will attempt to create but will fail with below error. This will help future users and will not spend time to figure out.

Error: error creating webhooks custom variable from https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks: 400 Bad Request: {"errors":["Invalid webhook"]}

Terraform Configuration Files

No response

Relevant debug or panic output

Error: error creating webhooks custom variable from https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks: 400 Bad Request: {"errors":["Invalid webhook"]}

Expected Behavior

String validation in place that prevents invalid name input.

Actual Behavior

Fail to create webhook.

Steps to Reproduce

resource "datadog_webhook" "foo" {
  name           = "test - webhook"
  url            = "example.com"
  encode_as      = "json"
  custom_headers = jsonencode({ "custom" : "header" })
  payload        = jsonencode({ "custom" : "payload" })
}

Important Factoids

No response

References

No response

jajera avatar Oct 14 '24 00:10 jajera