Skip to content

Commit e72b3d1

Browse files
authored
feat: additional outputs for public gateway and network acl (#66)
1 parent 8d5f37d commit e72b3d1

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ You need the following permissions to run this module.
180180

181181
| Name | Description |
182182
|------|-------------|
183+
| <a name="output_network_acls"></a> [network\_acls](#output\_network\_acls) | List of shortnames and IDs of network ACLs |
184+
| <a name="output_public_gateways"></a> [public\_gateways](#output\_public\_gateways) | Map of public gateways by zone |
183185
| <a name="output_subnet_detail_list"></a> [subnet\_detail\_list](#output\_subnet\_detail\_list) | A list of subnets containing names, CIDR blocks, and zones. |
184186
| <a name="output_subnet_ids"></a> [subnet\_ids](#output\_subnet\_ids) | The IDs of the subnets |
185187
| <a name="output_subnet_zone_list"></a> [subnet\_zone\_list](#output\_subnet\_zone\_list) | A list containing subnet IDs and subnet zones |

network_acls.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ locals {
104104
acl_object = {
105105
for network_acl in var.network_acls :
106106
network_acl.name => {
107+
name = network_acl.name
107108
rules = flatten([
108109
[
109110
# These rules cannot be added in a conditional operator due to inconsistant typing

outputs.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ output "vpc_crn" {
1919

2020
##############################################################################
2121

22+
##############################################################################
23+
# Public Gateways
24+
##############################################################################
25+
26+
output "public_gateways" {
27+
description = "Map of public gateways by zone"
28+
value = {
29+
for zone in [1, 2, 3] :
30+
"zone-${zone}" => (
31+
var.use_public_gateways["zone-${zone}"] == false
32+
? null
33+
: ibm_is_public_gateway.gateway["zone-${zone}"].id
34+
)
35+
}
36+
}
37+
38+
##############################################################################
2239

2340
##############################################################################
2441
# Subnet Outputs
@@ -62,3 +79,20 @@ output "subnet_zone_list" {
6279
}
6380

6481
##############################################################################
82+
83+
##############################################################################
84+
# Network ACLs
85+
##############################################################################
86+
87+
output "network_acls" {
88+
description = "List of shortnames and IDs of network ACLs"
89+
value = [
90+
for network_acl in local.acl_object :
91+
{
92+
shortname = network_acl.name
93+
id = ibm_is_network_acl.network_acl[network_acl.name].id
94+
}
95+
]
96+
}
97+
98+
##############################################################################

0 commit comments

Comments
 (0)