File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ resource "aws_main_route_table_association" "this" {
59
59
# Associations
60
60
# ##################################################
61
61
62
- # INFO: Conflict on create with `for_each`
63
62
resource "aws_route_table_association" "subnets" {
64
63
count = length (var. subnets )
65
64
@@ -68,10 +67,10 @@ resource "aws_route_table_association" "subnets" {
68
67
}
69
68
70
69
resource "aws_route_table_association" "gateways" {
71
- for_each = toset (var. gateways )
70
+ count = length (var. gateways )
72
71
73
72
route_table_id = aws_route_table. this . id
74
- gateway_id = each . value
73
+ gateway_id = var . gateways [ count . index ]
75
74
}
76
75
77
76
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ output "associated_subnets" {
109
109
110
110
output "associated_gateways" {
111
111
description = " A list of gateway IDs which is associated with the route table."
112
- value = values ( aws_route_table_association. gateways ) [* ]. gateway_id
112
+ value = aws_route_table_association. gateways [* ]. gateway_id
113
113
}
114
114
115
115
output "associated_vpc_gateway_endpoints" {
@@ -121,4 +121,3 @@ output "propagated_vpn_gateways" {
121
121
description = " A list of Virtual Private Gateway IDs which propagate routes from."
122
122
value = values (aws_vpn_gateway_route_propagation. this )[* ]. vpn_gateway_id
123
123
}
124
-
You can’t perform that action at this time.
0 commit comments