Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

vpc nat gateway #146

Open
Bugahans opened this issue Nov 3, 2017 · 0 comments
Open

vpc nat gateway #146

Bugahans opened this issue Nov 3, 2017 · 0 comments

Comments

@Bugahans
Copy link

Bugahans commented Nov 3, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant