Skip to content

Commit

Permalink
Merge pull request #22 from unifio/db-nonat-nolan
Browse files Browse the repository at this point in the history
Only create a NAT Gateway if Private LANS are requested
  • Loading branch information
kjonick1 authored Dec 20, 2016
2 parents 9b20e6f + 808a343 commit 8404938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions az/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ resource "aws_route_table_association" "rta_dmz" {

### Provisions NAT gateway
resource "aws_nat_gateway" "nat" {
count = "${length(split(",",var.az))}"
count = "${length(split(",",var.az)) * signum(var.lans_per_az)}"
allocation_id = "${element(aws_eip.eip_nat.*.id,count.index)}"
subnet_id = "${element(aws_subnet.dmz.*.id,count.index)}"
}

resource "aws_eip" "eip_nat" {
count = "${length(split(",",var.az))}"
count = "${length(split(",",var.az)) * signum(var.lans_per_az)}"
vpc = true
}

Expand Down

0 comments on commit 8404938

Please sign in to comment.