From d6f1342ae872c44662f7187299b92d5d7362f041 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 12 Oct 2017 22:54:58 +0200 Subject: [PATCH 1/3] Make aws_vpc_endpoint_service conditional --- main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.tf b/main.tf index 3e3f4b8fe..f47d27430 100644 --- a/main.tf +++ b/main.tf @@ -154,6 +154,8 @@ resource "aws_route" "private_nat_gateway" { # VPC Endpoint for S3 ###################### data "aws_vpc_endpoint_service" "s3" { + count = "${var.enable_s3_endpoint}" + service = "s3" } From 61eeadadac98db10d2ce25ba2e7c6817d12d27fe Mon Sep 17 00:00:00 2001 From: Michal Schott Date: Fri, 20 Oct 2017 15:07:16 +0200 Subject: [PATCH 2/3] NAT gateway should be tagged too. --- main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.tf b/main.tf index f47d27430..7ac49b53c 100644 --- a/main.tf +++ b/main.tf @@ -139,6 +139,8 @@ resource "aws_nat_gateway" "this" { allocation_id = "${element(aws_eip.nat.*.id, (var.single_nat_gateway ? 0 : count.index))}" subnet_id = "${element(aws_subnet.public.*.id, (var.single_nat_gateway ? 0 : count.index))}" + tags = "${merge(var.tags, map("Name", format("%s", var.name)))}" + depends_on = ["aws_internet_gateway.this"] } From 1da7b4ee59d75ba3bae0c48dba6023795755fe02 Mon Sep 17 00:00:00 2001 From: Felix Bechstein Date: Tue, 24 Oct 2017 09:52:41 +0200 Subject: [PATCH 3/3] Add AZ to natgateway name --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 7ac49b53c..7fc4679ef 100644 --- a/main.tf +++ b/main.tf @@ -139,7 +139,7 @@ resource "aws_nat_gateway" "this" { allocation_id = "${element(aws_eip.nat.*.id, (var.single_nat_gateway ? 0 : count.index))}" subnet_id = "${element(aws_subnet.public.*.id, (var.single_nat_gateway ? 0 : count.index))}" - tags = "${merge(var.tags, map("Name", format("%s", var.name)))}" + tags = "${merge(var.tags, map("Name", format("%s-%s", var.name, element(var.azs, (var.single_nat_gateway ? 0 : count.index)))))}" depends_on = ["aws_internet_gateway.this"] }