Skip to content

Commit

Permalink
fix: added count index for associating nat gateway (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshvardhan49 authored Oct 18, 2024
1 parent 158b6ca commit 5c6ea4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resource "aws_route" "ngw_route" {
count = var.create_private_subnets || length(var.nat_type) > 0 ? var.number_of_aws_az_use : 0
destination_cidr_block = "0.0.0.0/0"
network_interface_id = var.nat_type == "instance" ? module.ec2_nat_instance.0.network_interface_id : null
nat_gateway_id = var.nat_type == "gateway" ? element(aws_nat_gateway.ngw.*.id, var.number_of_nat_gw) : null
nat_gateway_id = var.nat_type == "gateway" ? element(aws_nat_gateway.ngw.*.id, count.index) : null
route_table_id = element(aws_route_table.private_route_table.*.id, count.index)
}

Expand Down

0 comments on commit 5c6ea4c

Please sign in to comment.