Commit 0a56c648 authored by Anton Babenko's avatar Anton Babenko

Fixed creation of aws_vpc_endpoint_route_table_association when intra_subnets...

Fixed creation of aws_vpc_endpoint_route_table_association when intra_subnets are not set (fixes 137)
parent 9ced5e96
...@@ -286,7 +286,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_s3" { ...@@ -286,7 +286,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_s3" {
} }
resource "aws_vpc_endpoint_route_table_association" "intra_s3" { resource "aws_vpc_endpoint_route_table_association" "intra_s3" {
count = "${var.create_vpc && var.enable_s3_endpoint ? 1 : 0}" count = "${var.create_vpc && var.enable_s3_endpoint && length(var.intra_subnets) > 0 ? 1 : 0}"
vpc_endpoint_id = "${aws_vpc_endpoint.s3.id}" vpc_endpoint_id = "${aws_vpc_endpoint.s3.id}"
route_table_id = "${element(aws_route_table.intra.*.id, 0)}" route_table_id = "${element(aws_route_table.intra.*.id, 0)}"
...@@ -323,7 +323,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_dynamodb" { ...@@ -323,7 +323,7 @@ resource "aws_vpc_endpoint_route_table_association" "private_dynamodb" {
} }
resource "aws_vpc_endpoint_route_table_association" "intra_dynamodb" { resource "aws_vpc_endpoint_route_table_association" "intra_dynamodb" {
count = "${var.create_vpc && var.enable_dynamodb_endpoint ? 1 : 0}" count = "${var.create_vpc && var.enable_dynamodb_endpoint && length(var.intra_subnets) > 0 ? 1 : 0}"
vpc_endpoint_id = "${aws_vpc_endpoint.dynamodb.id}" vpc_endpoint_id = "${aws_vpc_endpoint.dynamodb.id}"
route_table_id = "${element(aws_route_table.intra.*.id, 0)}" route_table_id = "${element(aws_route_table.intra.*.id, 0)}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment