diff --git a/routing/main.tf b/routing/main.tf index f02bab8..45f266e 100644 --- a/routing/main.tf +++ b/routing/main.tf @@ -55,7 +55,7 @@ resource "aws_route_table" "public" { } resource "aws_route_table_association" "public" { - for_each = { for subnet in var.public_subnet_ids : subnet.label => subnet } + for_each = { for subnet in var.public_subnets_ids : subnet.label => subnet } subnet_id = each.value.id route_table_id = aws_route_table.public[each.value.availability_zone].id } @@ -75,7 +75,7 @@ resource "aws_route_table" "private" { } resource "aws_route_table_association" "private" { - for_each = { for subnet in var.private_subnet_ids : subnet.label => subnet } + for_each = { for subnet in var.private_subnets_ids : subnet.label => subnet } subnet_id = each.value.id route_table_id = aws_route_table.private[each.value.availability_zone].id } @@ -88,7 +88,6 @@ resource "aws_route_table_association" "private" { #--- resource "aws_eip" "nat" { for_each = var.enable_igw && var.enable_nat ? local.availability_zones : local.empty - vpc_id = var.vpc_id vpc = true tags = merge( @@ -112,11 +111,11 @@ resource "aws_internet_gateway" "gateway" { # assume only 1 public subnet block (per AZ) # should figure out the first one locals { - public_subnet_ids_az = { for subnet in var.public_subnet_ids : subnet.availability_zone => subnet } + public_subnet_ids_az = { for subnet in var.public_subnets_ids : subnet.availability_zone => subnet } } resource "aws_nat_gateway" "nat" { - for_each = var.enable_igw && var.enable_nat ? zipmap(local.availability_zones, local.public_subnet_ids_az) : local.empty + for_each = var.enable_igw && var.enable_nat ? zipmap(local.availability_zones, local.public_subnets_ids_az) : local.empty allocation_id = aws_eip.nat[each.key].id subnet_id = each.value # depends_on = [aws_internet_gateway.gateway]