diff --git a/README.md b/README.md index 73c65c4e..dda4d6ea 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,7 @@ To attach access management tags to resources in this module, you need the follo |------|-------------| | [cidr\_blocks](#output\_cidr\_blocks) | List of CIDR blocks present in VPC stack | | [custom\_resolver\_hub](#output\_custom\_resolver\_hub) | The custom resolver created for the hub vpc. Only set if enable\_hub is set and skip\_custom\_resolver\_hub\_creation is false. | +| [default\_routing\_table](#output\_default\_routing\_table) | The default routing table ID and name that is created along with the VPC. | | [dns\_custom\_resolver\_id](#output\_dns\_custom\_resolver\_id) | The ID of the DNS Custom Resolver. | | [dns\_endpoint\_gateways\_by\_crn](#output\_dns\_endpoint\_gateways\_by\_crn) | The list of VPEs that are made available for DNS resolution in the created Spoke VPC. Only set if enable\_hub is false and enable\_hub\_vpc\_id OR enable\_hub\_vpc\_crn are true. | | [dns\_endpoint\_gateways\_by\_id](#output\_dns\_endpoint\_gateways\_by\_id) | The list of VPEs that are made available for DNS resolution in the created Spoke VPC. Only set if enable\_hub is false and enable\_hub\_vpc\_id OR enable\_hub\_vpc\_crn are true. | @@ -277,6 +278,8 @@ To attach access management tags to resources in this module, you need the follo | [dns\_zone\_state](#output\_dns\_zone\_state) | The state of the DNS zone. | | [network\_acls](#output\_network\_acls) | List of shortnames and IDs of network ACLs | | [public\_gateways](#output\_public\_gateways) | Map of public gateways by zone | +| [routing\_table\_ids](#output\_routing\_table\_ids) | List of routing table IDs created by this module. | +| [routing\_table\_routes](#output\_routing\_table\_routes) | List of routing table routes created by this module. | | [security\_group\_details](#output\_security\_group\_details) | Details of security group. | | [subnet\_detail\_list](#output\_subnet\_detail\_list) | A list of subnets containing names, CIDR blocks, and zones. | | [subnet\_detail\_map](#output\_subnet\_detail\_map) | A map of subnets containing IDs, CIDR blocks, and zones | diff --git a/outputs.tf b/outputs.tf index 043389ea..ff82570c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -148,6 +148,46 @@ output "vpc_data" { value = data.ibm_is_vpc.vpc } +############################################################################## +# Routing Tables +############################################################################## + +output "default_routing_table" { + description = "The default routing table ID and name that is created along with the VPC." + value = { + routing_table_id = data.ibm_is_vpc.vpc.default_routing_table + routing_table_name = data.ibm_is_vpc.vpc.default_routing_table_name + } +} + +output "routing_table_ids" { + description = "List of routing table IDs created by this module." + value = [ + for table in ibm_is_vpc_routing_table.route_table : + { + name = table.name + routing_table_id = table.routing_table + } + ] +} + +output "routing_table_routes" { + description = "List of routing table routes created by this module." + value = [ + for route in ibm_is_vpc_routing_table_route.routing_table_routes : + { + name = route.name + routing_table_id = route.routing_table + destination = route.destination + action = route.action + next_hop = route.next_hop + zone = route.zone + } + ] +} + +############################################################################## + ############################################################################## # Hub and Spoke specific configuration ############################################################################## diff --git a/solutions/fully-configurable/outputs.tf b/solutions/fully-configurable/outputs.tf index 6775160f..22a64436 100644 --- a/solutions/fully-configurable/outputs.tf +++ b/solutions/fully-configurable/outputs.tf @@ -44,6 +44,25 @@ output "network_acls" { value = module.vpc.network_acls } +############################################################################## +# Routing Tables +############################################################################## + +output "default_routing_table" { + description = "The default routing table ID and name that is created along with the VPC." + value = module.vpc.default_routing_table +} + +output "routing_table_ids" { + description = "List of routing table IDs created by this module." + value = module.vpc.routing_table_ids +} + +output "routing_table_routes" { + description = "List of routing table routes created by this module." + value = module.vpc.routing_table_routes +} + ############################################################################## # Subnet Outputs ##############################################################################