diff --git a/main.tf b/main.tf index 3e3f4b8fe..7fc4679ef 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-%s", var.name, element(var.azs, (var.single_nat_gateway ? 0 : count.index)))))}" + depends_on = ["aws_internet_gateway.this"] } @@ -154,6 +156,8 @@ resource "aws_route" "private_nat_gateway" { # VPC Endpoint for S3 ###################### data "aws_vpc_endpoint_service" "s3" { + count = "${var.enable_s3_endpoint}" + service = "s3" }