This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Description
Hi,
in the vpc module there is an error concerning the number of NAT Gateways created for each public network.
resource "aws_nat_gateway" "main" {
count = "${length(var.internal_subnets)}"
allocation_id = "${element(aws_eip.nat..id, count.index)}"
subnet_id = "${element(aws_subnet.external..id, count.index)}"
depends_on = ["aws_internet_gateway.main"]
}
resource "aws_eip" "nat" {
count = "${length(var.internal_subnets)}"
vpc = true
}
var.internal_subnets should be var.external_subnets
in my example I have 6 internal networks and 3 public networks and end up with 6 NAT Gateways