Skip to content

Commit

Permalink
Add nat_gateway_tags input (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharrisio authored and antonbabenko committed Jun 20, 2018
1 parent 0a56c64 commit a45c8ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `<map>` | no |
| private_route_table_tags | Additional tags for the private route tables | string | `<map>` | no |
| private_subnet_tags | Additional tags for the private subnets | string | `<map>` | no |
| private_subnets | A list of private subnets inside the VPC | string | `<list>` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a45c8ad

Please sign in to comment.