cloudposse / terraform-aws-components

Opinionated, self-contained Terraform root modules that each solve one, specific problem
https://docs.cloudposse.com/components/
Apache License 2.0
508 stars 215 forks source link

components_datadog-private-location-ecs Error: Missing resource instance key #842

Open pchafouleas opened 1 year ago

pchafouleas commented 1 year ago

Describe the Bug

Error: Missing resource instance key
on .terraform/modules/components_datadog-private-location-ecs/modules/datadog-private-location-ecs/main.tf line 9, in locals:
  datadog_location_config = jsondecode(datadog_synthetics_private_location.private_location.config)
Because datadog_synthetics_private_location.private_location has "count" set, its attributes must be accessed on specific instances.

For example, to correlate with indices of a referring resource, use:
    datadog_synthetics_private_location.private_location[count.index]

Expected Behavior

The datadog-private-location-ecs module to deploy a private space in datadog and an aws ecs fargate container.

Steps to Reproduce

I have this in my main.tf and am deploying using Terraform Cloud,

terraform {
  required_providers {
    datadog = {
      source = "DataDog/datadog"
    }
  }
}
provider "datadog" {
  api_key = var.datadog_api_key
  app_key = var.datadog_app_key
}
module "components_datadog-private-location-ecs" {
  source  = "cloudposse/components/aws//modules/datadog-private-location-ecs"
  version = "1.293.2"
  region = "us-west-2"
}

Screenshots

No response

Environment

Terraform version 1.4.6 (Terraform Cloud) cloudposse/components/aws//modules/datadog-private-location-ecs - version 1.295.0

Additional Context

I 100% recognize this may be user error and not a bug at all. I apologize in advance if it is not.

Thank you!

Benbentwo commented 9 months ago

Are you still having this issue? can you retry with the latest component version?