This repository was archived by the owner on Jul 11, 2023. It is now read-only.
File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### Modules
6
6
7
+ * nat-gateways: Fix association issue caused between ` nat_eip ` and
8
+ public subnets. This only affects resources using the ` nat_eip ` variable.
9
+
7
10
### Examples
8
11
9
12
# v0.9.16
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ locals {
15
15
# Number of new NATs to be created in case var.nat_eip is empty.
16
16
total_new_nat = var. enable_nat_creation ? (length (var. nat_eip ) == 0 ? local. total_nat_count : 0 ) : 0
17
17
# Gives the EIP ids. It would be either populated via data source or newly created (which is controlled by var.nat_eip).
18
- eip_ids = var. enable_nat_creation ? (length (var. nat_eip ) == 0 ? aws_eip. nat . * . id : values ( data. aws_eip . nat )[ * ] . id ) : []
18
+ eip_ids = var. enable_nat_creation ? (length (var. nat_eip ) == 0 ? aws_eip. nat . * . id : data. aws_eip . nat . * . id ) : []
19
19
}
20
20
21
21
# AWS Managed NAT Gateways
@@ -25,8 +25,8 @@ resource "aws_eip" "nat" {
25
25
}
26
26
27
27
data "aws_eip" "nat" {
28
- for_each = length (var . nat_eip ) != 0 ? toset (var. nat_eip ) : toset ([] )
29
- public_ip = each . value
28
+ count = length (var. nat_eip )
29
+ public_ip = element (var . nat_eip , count . index )
30
30
}
31
31
32
32
data "aws_subnet" "public" {
You can’t perform that action at this time.
0 commit comments