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

Plugin crash when creating datadog_synthetics_private_location #1476

Closed
Dcooley1350 opened this issue Jun 23, 2022 · 0 comments · Fixed by #1519
Closed

Plugin crash when creating datadog_synthetics_private_location #1476

Dcooley1350 opened this issue Jun 23, 2022 · 0 comments · Fixed by #1519

Comments

@Dcooley1350
Copy link

Terraform Version

Terraform v1.2.3 on darwin_arm64
provider registry.terraform.io/datadog/datadog v3.12.0

Affected Resource(s)

  • datadog_synthetics_private_location

Terraform Configuration Files

resource "datadog_synthetics_private_location" "synthetics_private_location" {
  name        = "${var.env}"
  description = "${var.env} Datadog synthetics private location"

  metadata {
    restricted_roles = []
  }
  
  tags        = [
    "clusterName:${var.cluster_name}",
    "project:${var.project}", 
    "env:${var.env}",
  ]
}

Debug Output

Debug logs gist

Panic Output

panic gist

Expected Behavior

The resource should either:

  1. Show no changes on later plans/applies when the metadata { restricted_roles = [] } block is omitted during creation of the resources.
  2. Not cause the plugin to crash when the block metadata { restricted_roles = [] } is included in the resource during initial creation of the resources.

Actual Behavior

When metadata { restricted_roles = [] } is included in the resource during the initial apply to create the resources, the plugin crashes. If this block is not included in the resource, the resource shows a necessary change on every sequential apply to remove this block from the resource

Steps to Reproduce

Reproduce the plugin crash:

  • Include metadata { restricted_roles = [] } in the resource and run terraform apply to create the resource.

Reproduce the "changes are always necessary" problem:

  • Omit metadata { restricted_roles = [] } from the resource and run terraform apply to create the resource. After the resource is created, run terraform apply again. The plan will show that the resource must be updated in place with:
      - metadata {
          - restricted_roles = [] -> null
        }
therve added a commit that referenced this issue Aug 5, 2022
Don't crash when the list is empty and don't show an perpetual diff.

Closes #1476
skarimo pushed a commit that referenced this issue Aug 23, 2022
Don't crash when the list is empty and don't show an perpetual diff.

Closes #1476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant