diff --git a/module-metadata.json b/module-metadata.json index cd4db630..15cfacc6 100644 --- a/module-metadata.json +++ b/module-metadata.json @@ -377,7 +377,7 @@ "description": "List of shortnames and IDs of network ACLs", "pos": { "filename": "outputs.tf", - "line": 91 + "line": 105 } }, "public_gateways": { @@ -436,7 +436,7 @@ "description": "Details of VPC flow logs collector", "pos": { "filename": "outputs.tf", - "line": 108 + "line": 122 } }, "vpc_id": { diff --git a/outputs.tf b/outputs.tf index bc52e6b1..a7f7fbf0 100644 --- a/outputs.tf +++ b/outputs.tf @@ -80,8 +80,22 @@ output "subnet_zone_list" { output "subnet_detail_map" { description = "A map of subnets containing IDs, CIDR blocks, and zones" - 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 }]]) + value = { + for zone_name in distinct([ + for subnet in ibm_is_subnet.subnet : + subnet.zone + ]) : + "zone-${substr(zone_name, -1, length(zone_name))}" => [ + for subnet in ibm_is_subnet.subnet : + { + id = subnet.id + zone = subnet.zone + cidr_block = subnet.ipv4_cidr_block + } if subnet.zone == zone_name + ] + } } + ############################################################################## ##############################################################################