44
55output "vpc_name" {
66 description = " Name of VPC created"
7- value = var . create_vpc == true ? ibm_is_vpc . vpc [ 0 ] . name : data . ibm_is_vpc . vpc [ 0 ] . name
7+ value = local . vpc_data . name
88}
99
1010output "vpc_id" {
@@ -14,7 +14,7 @@ output "vpc_id" {
1414
1515output "vpc_crn" {
1616 description = " CRN of VPC created"
17- value = var . create_vpc == true ? ibm_is_vpc . vpc [ 0 ] . crn : data . ibm_is_vpc . vpc [ 0 ] . crn
17+ value = local . vpc_data . crn
1818}
1919
2020# #############################################################################
@@ -44,7 +44,7 @@ output "public_gateways" {
4444output "subnet_ids" {
4545 description = " The IDs of the subnets"
4646 value = [
47- for subnet in ibm_is_subnet . subnet :
47+ for subnet in local . subnets :
4848 subnet . id
4949 ]
5050}
@@ -53,11 +53,11 @@ output "subnet_detail_list" {
5353 description = " A list of subnets containing names, CIDR blocks, and zones."
5454 value = {
5555 for zone_name in distinct ([
56- for subnet in ibm_is_subnet . subnet :
56+ for subnet in local . subnets :
5757 subnet.zone
5858 ]) :
5959 zone_name = > {
60- for subnet in ibm_is_subnet . subnet :
60+ for subnet in local . subnets :
6161 subnet.name = > {
6262 id = subnet.id
6363 cidr = subnet.ipv4_cidr_block
@@ -70,7 +70,7 @@ output "subnet_detail_list" {
7070output "subnet_zone_list" {
7171 description = " A list containing subnet IDs and subnet zones"
7272 value = [
73- for subnet in ibm_is_subnet . subnet : {
73+ for subnet in local . subnets : {
7474 name = subnet . name
7575 id = subnet . id
7676 zone = subnet . zone
@@ -84,11 +84,11 @@ output "subnet_detail_map" {
8484 description = " A map of subnets containing IDs, CIDR blocks, and zones"
8585 value = {
8686 for zone_name in distinct ([
87- for subnet in ibm_is_subnet . subnet :
87+ for subnet in local . subnets :
8888 subnet.zone
8989 ]) :
9090 " zone-${substr(zone_name, -1, length(zone_name))}" => [
91- for subnet in ibm_is_subnet . subnet :
91+ for subnet in local . subnets :
9292 {
9393 id = subnet.id
9494 zone = subnet.zone
@@ -143,8 +143,8 @@ output "cidr_blocks" {
143143}
144144
145145output "vpc_data" {
146- description = " Data of the VPC created."
147- value = ibm_is_vpc . vpc
146+ description = " Data of the VPC used in this module, created or existing ."
147+ value = local . vpc_data
148148}
149149
150150# #############################################################################
0 commit comments