Skip to content

Commit 8272639

Browse files
fix: replace zipmap in subnet_detail_map output (#449)
Co-authored-by: imprateeksh <[email protected]>
1 parent 3dc68ee commit 8272639

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

module-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
"description": "List of shortnames and IDs of network ACLs",
378378
"pos": {
379379
"filename": "outputs.tf",
380-
"line": 91
380+
"line": 105
381381
}
382382
},
383383
"public_gateways": {
@@ -436,7 +436,7 @@
436436
"description": "Details of VPC flow logs collector",
437437
"pos": {
438438
"filename": "outputs.tf",
439-
"line": 108
439+
"line": 122
440440
}
441441
},
442442
"vpc_id": {

outputs.tf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,22 @@ output "subnet_zone_list" {
8080

8181
output "subnet_detail_map" {
8282
description = "A map of subnets containing IDs, CIDR blocks, and zones"
83-
value = zipmap([for prefix, _ in var.address_prefixes : prefix], [for subnet in ibm_is_subnet.subnet : [{ id = subnet.id, zone = subnet.zone, cidr_block = subnet.ipv4_cidr_block }]])
83+
value = {
84+
for zone_name in distinct([
85+
for subnet in ibm_is_subnet.subnet :
86+
subnet.zone
87+
]) :
88+
"zone-${substr(zone_name, -1, length(zone_name))}" => [
89+
for subnet in ibm_is_subnet.subnet :
90+
{
91+
id = subnet.id
92+
zone = subnet.zone
93+
cidr_block = subnet.ipv4_cidr_block
94+
} if subnet.zone == zone_name
95+
]
96+
}
8497
}
98+
8599
##############################################################################
86100

87101
##############################################################################

0 commit comments

Comments
 (0)