Skip to content

Commit 0a56c64

Browse files
committed
Fixed creation of aws_vpc_endpoint_route_table_association when intra_subnets are not set (fixes 137)
1 parent 9ced5e9 commit 0a56c64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_s3" {
286286
}
287287

288288
resource "aws_vpc_endpoint_route_table_association" "intra_s3" {
289-
count = "${var.create_vpc && var.enable_s3_endpoint ? 1 : 0}"
289+
count = "${var.create_vpc && var.enable_s3_endpoint && length(var.intra_subnets) > 0 ? 1 : 0}"
290290

291291
vpc_endpoint_id = "${aws_vpc_endpoint.s3.id}"
292292
route_table_id = "${element(aws_route_table.intra.*.id, 0)}"
@@ -323,7 +323,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_dynamodb" {
323323
}
324324

325325
resource "aws_vpc_endpoint_route_table_association" "intra_dynamodb" {
326-
count = "${var.create_vpc && var.enable_dynamodb_endpoint ? 1 : 0}"
326+
count = "${var.create_vpc && var.enable_dynamodb_endpoint && length(var.intra_subnets) > 0 ? 1 : 0}"
327327

328328
vpc_endpoint_id = "${aws_vpc_endpoint.dynamodb.id}"
329329
route_table_id = "${element(aws_route_table.intra.*.id, 0)}"

0 commit comments

Comments
 (0)