Skip to content

datadog_webhook fails to create webhook #2618

Open
@jajera

Description

@jajera

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions