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

feat: subnet output created to be consumed by terraform-base-ocp-vpc module #427

Merged
merged 12 commits into from
Mar 14, 2023
Merged
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ You need the following permissions to run this module.
| <a name="output_network_acls"></a> [network\_acls](#output\_network\_acls) | List of shortnames and IDs of network ACLs |
| <a name="output_public_gateways"></a> [public\_gateways](#output\_public\_gateways) | Map of public gateways by zone |
| <a name="output_subnet_detail_list"></a> [subnet\_detail\_list](#output\_subnet\_detail\_list) | A list of subnets containing names, CIDR blocks, and zones. |
| <a name="output_subnet_detail_map"></a> [subnet\_detail\_map](#output\_subnet\_detail\_map) | A map of subnets containing IDs, CIDR blocks, and zones |
| <a name="output_subnet_ids"></a> [subnet\_ids](#output\_subnet\_ids) | The IDs of the subnets |
| <a name="output_subnet_zone_list"></a> [subnet\_zone\_list](#output\_subnet\_zone\_list) | A list containing subnet IDs and subnet zones |
| <a name="output_vpc_crn"></a> [vpc\_crn](#output\_vpc\_crn) | CRN of VPC created |
Expand Down
12 changes: 10 additions & 2 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"description": "List of shortnames and IDs of network ACLs",
"pos": {
"filename": "outputs.tf",
"line": 87
"line": 91
}
},
"public_gateways": {
Expand All @@ -419,6 +419,14 @@
"line": 52
}
},
"subnet_detail_map": {
"name": "subnet_detail_map",
"description": "A map of subnets containing IDs, CIDR blocks, and zones",
"pos": {
"filename": "outputs.tf",
"line": 81
}
},
"subnet_ids": {
"name": "subnet_ids",
"description": "The IDs of the subnets",
Expand Down Expand Up @@ -451,7 +459,7 @@
"description": "Details of VPC flow logs collector",
"pos": {
"filename": "outputs.tf",
"line": 104
"line": 108
}
},
"vpc_id": {
Expand Down
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ 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 }]])
}
##############################################################################

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