diff --git a/README.md b/README.md index a4991c89c..bb7d89be3 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ Terraform version 0.10.3 or newer is required for this module to work. | map_public_ip_on_launch | Should be false if you do not want to auto-assign public IP on launch | string | `true` | no | | name | Name to be used on all the resources as identifier | string | `` | no | | one_nat_gateway_per_az | Should be true if you want only one NAT Gateway per availability zone. Requires `var.azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.azs`. | string | `false` | no | +| nat_gateway_tags | Additional tags for the nat gateways | string | `` | no | | private_route_table_tags | Additional tags for the private route tables | string | `` | no | | private_subnet_tags | Additional tags for the private subnets | string | `` | no | | private_subnets | A list of private subnets inside the VPC | string | `` | no | diff --git a/main.tf b/main.tf index b62425357..1bd9b17ff 100644 --- a/main.tf +++ b/main.tf @@ -245,7 +245,7 @@ resource "aws_nat_gateway" "this" { allocation_id = "${element(local.nat_gateway_ips, (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)))))}" + tags = "${merge(var.tags, var.nat_gateway_tags, map("Name", format("%s-%s", var.name, element(var.azs, (var.single_nat_gateway ? 0 : count.index)))))}" depends_on = ["aws_internet_gateway.this"] } diff --git a/variables.tf b/variables.tf index 6df338702..5462800b9 100644 --- a/variables.tf +++ b/variables.tf @@ -198,6 +198,11 @@ variable "dhcp_options_tags" { default = {} } +variable "nat_gateway_tags" { + description = "Additional tags for the nat gateways" + default = {} +} + variable "enable_dhcp_options" { description = "Should be true if you want to specify a DHCP options set with a custom domain name, DNS servers, NTP servers, netbios servers, and/or netbios server type" default = false