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

Error: : invalid or unknown key: id on datadog dashboard #947

Closed
sparky005 opened this issue Feb 23, 2021 · 4 comments · Fixed by #1036
Closed

Error: : invalid or unknown key: id on datadog dashboard #947

sparky005 opened this issue Feb 23, 2021 · 4 comments · Fixed by #1036

Comments

@sparky005
Copy link

Terraform Version

+ provider registry.terraform.io/hashicorp/aws v3.29.1
+ provider registry.terraform.io/terraform-providers/datadog v2.21.0

Affected Resource(s)

  • datadog_dashboard

Terraform Configuration Files

Any datadog dashboard with an id parameter specified

Expected Behavior

Terraform should plan / apply the dashboard with my chosen ID

Actual Behavior

Error: : invalid or unknown key: id

Steps to Reproduce

terraform plan or terraform apply any datadog dashboard with an ID parameter set.

Important Factoids

The docs mention that an ID parameter can be set, but the code doesn't actually have that parameter. So either the docs need to be updated or the provider does, I'm just not sure which.

@therve
Copy link
Contributor

therve commented Feb 23, 2021

id is a protected attribute in Terraform. We switched to generated documentation and it started exposing this I think (because It's an attribute? Not sure why it's not marked as such). We'll update the doc, thanks.

@sparky005
Copy link
Author

Got it, thanks @therve!

@sandeeplamb
Copy link

sandeeplamb commented Feb 24, 2021

Faced same and it took me here. Clear now.
Was working to get the dashboard URL in outputs. If I know the ID before, it's possible to make dashboard URL.
But it's possible via like this too. I don't need to know the ID beforehand.

output "dashboard_url" {
  value = join("", [
    "https://app.datadoghq.eu",
    datadog_dashboard.dashboard_resource_name.url
  ])
  description = "URL for the dashboard"
}

@nmuesch
Copy link
Contributor

nmuesch commented Mar 5, 2021

Thanks for the report on this. As therve noted, we're using the tfplugindocs generation tool. I've opened an issue upstream (and a corresponding PR to attempt a fix) - hashicorp/terraform-plugin-docs#45

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