terraform-aws-components
terraform-aws-components copied to clipboard
components_datadog-private-location-ecs Error: Missing resource instance key
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!
Are you still having this issue? can you retry with the latest component version?