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

Panic on apply for datadog_webhook resources #2539

Open
jakevictor opened this issue Aug 23, 2024 · 1 comment
Open

Panic on apply for datadog_webhook resources #2539

jakevictor opened this issue Aug 23, 2024 · 1 comment
Labels

Comments

@jakevictor
Copy link

Datadog Terraform Provider Version

v3.43.0 and v3.43.1

Terraform Version

v1.9.5

What resources or data sources are affected?

resource_datadog_webhook

Terraform Configuration Files

terraform {
  required_providers {
    datadog = {
      source  = "DataDog/datadog"
      version = "3.43.1"
    }
  }
}

provider "datadog" {
  api_url = "https://us5.datadoghq.com/"
  api_key = var.datadog_api_key
  app_key = var.datadog_app_key
}

resource "datadog_webhook" "test" {
  name = "ProviderBugTest"
  url  = "https://example.com/"
}

Relevant debug or panic output

https://gist.github.com/jakevictor/a5ca09a8a52c0df09a6a0e3bd0ab0a84

Expected Behavior

The plugin should create the resource.

Actual Behavior

The plugin crashed.

Steps to Reproduce

  1. terraform init
  2. terraform apply

Important Factoids

I've encountered the issue on v3.43.0 and v3.43.1, but not on v3.42.0.

References

No response

@jakevictor jakevictor added the bug label Aug 23, 2024
@jakevictor
Copy link
Author

It looks like the bug is specific to datadog_webhook resources where the optional encode_as argument isn't set. Explicitly setting encode_as to the API's default of json seems to work as a workaround:

resource "datadog_webhook" "test" {
  name      = "ProviderBugTest"
  url       = "https://example.com/"
  encode_as = "json"
}

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

No branches or pull requests

1 participant