Skip to content

Commit a660d5f

Browse files
fix: Support existing VCN in other compartment (#564)
fix: Support existing VCN in other compartment
1 parent bf5e6c3 commit a660d5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

locals.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ locals {
66
operator_private_ip = var.create_operator == true ? module.operator[0].operator_private_ip : ""
77
operator_instance_principal_group_name = var.create_operator == true ? module.operator[0].operator_instance_principal_group_name : ""
88

9-
vcn_id = var.create_vcn == true ? module.vcn[0].vcn_id : coalesce(var.vcn_id, data.oci_core_vcns.vcns[0].virtual_networks[0].id)
10-
ig_route_id = var.create_vcn == true ? module.vcn[0].ig_route_id : coalesce(var.ig_route_table_id, data.oci_core_route_tables.ig[0].route_tables[0].id)
11-
nat_route_id = var.create_vcn == true ? module.vcn[0].nat_route_id : coalesce(var.nat_route_table_id, data.oci_core_route_tables.nat[0].route_tables[0].id)
9+
vcn_id = var.create_vcn == true ? module.vcn[0].vcn_id : coalesce(var.vcn_id, try(data.oci_core_vcns.vcns[0].virtual_networks[0].id,""))
10+
ig_route_id = var.create_vcn == true ? module.vcn[0].ig_route_id : coalesce(var.ig_route_table_id, try(data.oci_core_route_tables.ig[0].route_tables[0].id,""))
11+
nat_route_id = var.create_vcn == true ? module.vcn[0].nat_route_id : coalesce(var.nat_route_table_id, try(data.oci_core_route_tables.nat[0].route_tables[0].id,""))
1212

1313
validate_drg_input = var.create_drg && (var.drg_id != null) ? tobool("[ERROR]: create_drg variable can not be true if drg_id is provided.]") : true
1414
}

0 commit comments

Comments
 (0)