Hello, I’m facing a problem with applying bool
value to first element of resource.
Resource itself creates with for_each
function, here is the code:
resource "aws_vpc_endpoint" "cluster_ecrdkr" {
for_each = { for id, subnet in local.subnet.cluster.self : id => subnet if local.target.init.registry && local.subnet.cluster.init }
depends_on = [ var.dependency, data.aws_vpc_endpoint_service.ecr_dkr ]
subnet_ids = [ each.value ]
private_dns_enabled = true
}
So problem is, I’ve in total 3 resource (cluster_ecrdkr
) based on how much subnets I have (3 subnets), but attribute private_dns_enabled
is only valid for only 1 endpoint, here is the error:
Error creating VPC Endpoint: InvalidParameter: private-dns-enabled cannot be set because there is already a conflicting DNS domain for *.dkr.ecr.eu-central-1.amazonaws.com in the VPC vpc-026cb64a33ccdcd96
│ status code: 400, request id: a152a654-aca1-4ef3-a688-6e451d4af584
Can someone help me to resolve this situation