Closed dbanetto closed 2 years ago
terraform 1.2.3 and terraform-provider-datadog v3.17.0
1.2.3
terraform-provider-datadog
v3.17.0
Please list the resources as a list, for example:
datadog_dashboard
datadog_dashboard.slo_list_definition
If this issue affects multiple resources, it may be an issue with Terraform's core, so please mention this.
resource "datadog_dashboard" "board" { layout_type = "ordered" notify_list = [] reflow_type = "auto" title = "test" widget { group_definition { layout_type = "ordered" widget { slo_list_definition { title = "SLOs" request { request_type = "slo_list" query { query_string = "env:prod" limit = 10 } } } } } } }
When running a terraform import for a dashboard that includes the slo_list_definition widget
terraform import
slo_list_definition
│ Error: object contains unparsed element: map[requests:[map[query:map[limit:10 query_string:env:prod] request_type:slo_list]] title:SLOs type:slo_list]
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.
crash.log
What should have happened?
slo_list_defintion
group_defintion
What actually happened?
terraform apply
terraform plan
Please list the steps required to reproduce the issue, for example:
From the example terraform code above,
terraform import datadog_dashboard.board <id>
N/A
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
Thanks, this is closed by https://github.com/DataDog/terraform-provider-datadog/pull/1624 and we just released 3.18.0 which includes this fix
Terraform Version
terraform
1.2.3
andterraform-provider-datadog
v3.17.0
Affected Resource(s)
Please list the resources as a list, for example:
datadog_dashboard
, in particulardatadog_dashboard.slo_list_definition
If this issue affects multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
When running a
terraform import
for a dashboard that includes theslo_list_definition
widgetPanic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the
crash.log
.Crash output from terraform (
```log Stack trace from the terraform-provider-datadog_v3.17.0 plugin: panic: [widget 0 group_definition 0 widget 0 slo_list_definition 0] doesn't end with [widget 0] goroutine 194 [running]: github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils.(*ResourceDataKey).Remove(0xc000c36f10, {0x1de92c0, 0xc001474a30}) github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils/key.go:63 +0x214 github.com/terraform-providers/terraform-provider-datadog/datadog.buildTerraformGroupDefinition({0x0, 0x0, {0xc000b79058, 0x7}, 0xc000b79075, 0xc0013c4190, 0x0, {0xc000b79070, 0x5}, {0xc0007d6700, ...}, ...}, ...) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_dashboard.go:1353 +0x54a github.com/terraform-providers/terraform-provider-datadog/datadog.buildTerraformWidget({{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000b0cbd0, ...}, ...}, ...) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_dashboard.go:1110 +0x29a5 github.com/terraform-providers/terraform-provider-datadog/datadog.buildTerraformWidgets(0xc000c372f8, 0xc0006f1380) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_dashboard.go:1077 +0x225 github.com/terraform-providers/terraform-provider-datadog/datadog.updateDashboardState(0x2029ee0, 0xc000c37220) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_dashboard.go:266 +0x31e github.com/terraform-providers/terraform-provider-datadog/datadog.resourceDatadogDashboardRead({0x2290160, 0xc00129a780}, 0xc0006f1380, {0x1d73be0, 0xc000908870}) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_dashboard.go:312 +0x397 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00019b880, {0x2290160, 0xc00129a780}, 0xd, {0x1d73be0, 0xc000908870}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:724 +0x12e github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00019b880, {0x2290160, 0xc00129a780}, 0xc00148e0d0, {0x1d73be0, 0xc000908870}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:1015 +0x585 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc0003ca000, {0x22900b8, 0xc000c0c6c0}, 0xc000c0c740) github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/grpc_provider.go:613 +0x574 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0003a4d20, {0x2290160, 0xc00129a1b0}, 0xc000a540c0) github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:746 +0x48c github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x1fdf660, 0xc0003a4d20}, {0x2290160, 0xc00129a1b0}, 0xc000a54060, 0x0) github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170 google.golang.org/grpc.(*Server).processUnaryRPC(0xc000230c40, {0x229f3a0, 0xc0007029c0}, 0xc00129c000, 0xc00058f650, 0x2de6870, 0x0) google.golang.org/grpc@v1.45.0/server.go:1282 +0xccf google.golang.org/grpc.(*Server).handleStream(0xc000230c40, {0x229f3a0, 0xc0007029c0}, 0xc00129c000, 0x0) google.golang.org/grpc@v1.45.0/server.go:1619 +0xa2a google.golang.org/grpc.(*Server).serveStreams.func1.2() google.golang.org/grpc@v1.45.0/server.go:921 +0x98 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.45.0/server.go:919 +0x294 Error: The terraform-provider-datadog_v3.17.0 plugin crashed! ```1.2.3
) withterraform-provider-datadog
v3.17.0
Expected Behavior
What should have happened?
slo_list_defintion
is in agroup_defintion
Actual Behavior
What actually happened?
terraform apply
creates the resource then panicsterraform plan
panics when refreshing remote of thedatadog_dashboard
resourceterraform import
fails to importSteps to Reproduce
Please list the steps required to reproduce the issue, for example:
From the example terraform code above,
terraform apply
terraform plan
terraform import datadog_dashboard.board <id>
Important Factoids
N/A
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: