Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace zipmap in output.tf #449

Merged
merged 5 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
"description": "List of shortnames and IDs of network ACLs",
"pos": {
"filename": "outputs.tf",
"line": 91
"line": 105
}
},
"public_gateways": {
Expand Down Expand Up @@ -436,7 +436,7 @@
"description": "Details of VPC flow logs collector",
"pos": {
"filename": "outputs.tf",
"line": 108
"line": 122
}
},
"vpc_id": {
Expand Down
16 changes: 15 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
}
}

##############################################################################

##############################################################################
Expand Down