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

vpc nat gateway #146

Description

@Bugahans

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions