File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,9 @@ resource "aws_route_table_association" "public" {
153153}
154154
155155resource "aws_route" "public_internet_gateway" {
156- count = local. create_public_subnets && var. create_igw ? 1 : 0
156+ count = local. create_public_subnets && var. create_igw ? local . num_public_route_tables : 0
157157
158- route_table_id = aws_route_table. public [0 ]. id
158+ route_table_id = aws_route_table. public [count . index ]. id
159159 destination_cidr_block = " 0.0.0.0/0"
160160 gateway_id = aws_internet_gateway. this [0 ]. id
161161
@@ -165,9 +165,9 @@ resource "aws_route" "public_internet_gateway" {
165165}
166166
167167resource "aws_route" "public_internet_gateway_ipv6" {
168- count = local. create_public_subnets && var. create_igw && var. enable_ipv6 ? 1 : 0
168+ count = local. create_public_subnets && var. create_igw && var. enable_ipv6 ? local . num_public_route_tables : 0
169169
170- route_table_id = aws_route_table. public [0 ]. id
170+ route_table_id = aws_route_table. public [count . index ]. id
171171 destination_ipv6_cidr_block = " ::/0"
172172 gateway_id = aws_internet_gateway. this [0 ]. id
173173}
You can’t perform that action at this time.
0 commit comments