File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,8 @@ resource "aws_vpc_endpoint" "dynamodb" {
2929}
3030
3131resource "aws_vpc_endpoint_route_table_association" "private_dynamodb" {
32- for_each = var. vpc_endpoint_dynamodb_gateway ? {
33- for idx , subnet in aws_subnet . private : idx => subnet
34- } : {}
35- route_table_id = var. multi_nat || var. multi_az_private_rtb ? aws_route_table. private [each . keyk ]. id : aws_route_table. private [0 ]. id
32+ count = var. vpc_endpoint_dynamodb_gateway ? length (aws_subnet. private ) : 0
33+ route_table_id = var. multi_nat || var. multi_az_private_rtb ? aws_route_table. private [count . index ]. id : aws_route_table. private [0 ]. id
3634 vpc_endpoint_id = aws_vpc_endpoint. dynamodb [0 ]. id
3735}
3836
Original file line number Diff line number Diff line change @@ -21,10 +21,7 @@ resource "aws_vpc_endpoint" "s3" {
2121}
2222
2323resource "aws_vpc_endpoint_route_table_association" "private" {
24- for_each = var. vpc_endpoint_s3_gateway ? {
25- for idx , subnet in aws_subnet . private : idx => subnet
26- } : {}
27-
28- route_table_id = var. multi_nat || var. multi_az_private_rtb ? aws_route_table. private [each . key ]. id : aws_route_table. private [0 ]. id
24+ count = var. vpc_endpoint_s3_gateway ? length (aws_subnet. private ) : 0
25+ route_table_id = var. multi_nat || var. multi_az_private_rtb ? aws_route_table. private [count . index ]. id : aws_route_table. private [0 ]. id
2926 vpc_endpoint_id = aws_vpc_endpoint. s3 [0 ]. id
3027}
You can’t perform that action at this time.
0 commit comments