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

version 3.44.0 breaks on dynamic datadog_dashboard resource #2597

Open
jeff-knurek opened this issue Oct 1, 2024 · 1 comment
Open

version 3.44.0 breaks on dynamic datadog_dashboard resource #2597

jeff-knurek opened this issue Oct 1, 2024 · 1 comment
Labels

Comments

@jeff-knurek
Copy link

Datadog Terraform Provider Version

3.44.0

Terraform Version

v1.6.3

What resources or data sources are affected?

datadog_dashboard

Terraform Configuration Files

It's a pretty complex dynamic config that contains a bit of business logic, so can't share the full details, which I know makes it difficult to reproduce. 

locals {
  my_var = [
    {
      title        = "title"
      color        = "vivid_purple"
      app_name     = "app"
      queue        = "queue"
    }
]}

resource "datadog_dashboard" "my_dashboard" {
  title            = "My Dashboard"
  description      = "Created using Terraform"
  layout_type      = "ordered"
  reflow_type      = "auto"
  restricted_roles = ["role-id"]

  dynamic "widget" {
    for_each = local.my_var
    content {

      group_definition {
        background_color = widget.value["color"]
        layout_type      = "ordered"
        show_title       = true
        title            = widget.value["title"]

        widget {
        }
      }
    }
  }

  template_variable {
    name     = "var"
    prefix   = "var"
    defaults = ["value"]
  }
}

Relevant debug or panic output

This is the standard output seen:

│ Error: object contains unparsed element: map[]
│
│   with datadog_dashboard.my_dashboard,
│   on dashboard-util.tf line 107, in resource "datadog_dashboard" "my_dashboard":
│  107: resource "datadog_dashboard" "my_dashboard" {

This is what is available in the debug logs:

2024-10-01T10:38:40.107+0800 [DEBUG] provider.terraform-provider-datadog_v3.44.0
2024-10-01T10:38:42.034+0800 [ERROR] provider.terraform-provider-datadog_v3.44.0: Response contains error diagnostic: diagnostic_summary="object contains unparsed element: map[]" tf_resource_type=datadog_dashboard diagnostic_severity=ERROR diagnostic_detail="" tf_provider_addr=registry.terraform.io/DataDog/datadog tf_rpc=ReadResource @module=sdk.proto tf_proto_version=5.3 tf_req_id=3647bf9c-5fdb-8040-b33d-9d91e0a7abe8 @caller=github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/diag/diagnostics.go:58 timestamp="2024-10-01T10:38:42.034+0800"
2024-10-01T10:38:42.037+0800 [ERROR] vertex "datadog_dashboard.my_dashboard" error: object contains unparsed element: map[]
2024-10-01T10:38:42.037+0800 [ERROR] vertex "datadog_dashboard.my_dashboard (expand)" error: object contains unparsed element: map[]
2024-10-01T10:38:42.037+0800 [INFO]  backend/local: plan operation completed

Expected Behavior

no error, or at least something with a bit more detail to know what is causing the failure

Actual Behavior

terraform exists in error state with no useful information

Steps to Reproduce

The error only shows when the UI version has been changed manually and terraform needs to reset the state. If the change is initiated by a change in the terraform code, the error doesn't show up.

Important Factoids

The workaround found is to rollback to version 3.43.1 (or earlier) with terraform init -upgrade.

References

No response

@jeff-knurek jeff-knurek added the bug label Oct 1, 2024
@skarimo
Copy link
Member

skarimo commented Oct 3, 2024

Thanks for the report. Will be resolved by the following in the next release: DataDog/datadog-api-client-go#2702

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

2 participants