Skip to content

Commit a68b767

Browse files
committed
add condition to data soruce
1 parent 0eefe64 commit a68b767

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/vpc-endpoints/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ locals {
99
}
1010

1111
data "aws_vpc_endpoint_service" "this" {
12-
for_each = local.endpoints
12+
for_each = {
13+
for k, v in local.endpoints : k => v
14+
if !try(contains(keys(v), "service_endpoint"), false) # Skip if service_endpoint is defined, needed when the vpc endpoint service is in a different AWS account than the vpc endpoint
15+
}
1316

1417
service = try(each.value.service, null)
1518
service_name = try(each.value.service_name, null)

0 commit comments

Comments
 (0)