11resource "oci_core_vcn" "vcn" {
22 count = var. use_existing_vcn ? 0 : 1
33 cidr_block = var. vcn_subnet
4- compartment_id = var. targetCompartment
4+ compartment_id = var. vcn_compartment
55 display_name = " ${ local . cluster_name } _VCN"
66 dns_label = " cluster"
77}
88
99resource "oci_core_security_list" "internal-security-list" {
1010 count = var. use_existing_vcn ? 0 : 1
1111 vcn_id = oci_core_vcn. vcn [0 ]. id
12- compartment_id = var. targetCompartment
12+ compartment_id = var. vcn_compartment
1313
1414 ingress_security_rules {
1515 protocol = " all"
@@ -41,7 +41,7 @@ resource "oci_core_security_list" "internal-security-list" {
4141resource "oci_core_security_list" "public-security-list" {
4242 count = var. use_existing_vcn ? 0 : 1
4343 vcn_id = oci_core_vcn. vcn [0 ]. id
44- compartment_id = var. targetCompartment
44+ compartment_id = var. vcn_compartment
4545
4646 ingress_security_rules {
4747 protocol = " all"
@@ -83,22 +83,22 @@ resource "oci_core_security_list" "public-security-list" {
8383resource "oci_core_internet_gateway" "ig1" {
8484 count = var. use_existing_vcn ? 0 : 1
8585 vcn_id = oci_core_vcn. vcn [0 ]. id
86- compartment_id = var. targetCompartment
86+ compartment_id = var. vcn_compartment
8787 display_name = " ${ local . cluster_name } _internet-gateway"
8888}
8989
9090resource "oci_core_nat_gateway" "ng1" {
9191 count = var. use_existing_vcn ? 0 : 1
9292 vcn_id = oci_core_vcn. vcn [0 ]. id
93- compartment_id = var. targetCompartment
93+ compartment_id = var. vcn_compartment
9494 display_name = " ${ local . cluster_name } _nat-gateway"
9595}
9696
9797
9898resource "oci_core_service_gateway" "sg1" {
9999 count = var. use_existing_vcn ? 0 : 1
100100 vcn_id = oci_core_vcn. vcn [0 ]. id
101- compartment_id = var. targetCompartment
101+ compartment_id = var. vcn_compartment
102102 display_name = " ${ local . cluster_name } _service-gateway"
103103
104104 services {
@@ -108,7 +108,7 @@ resource "oci_core_service_gateway" "sg1" {
108108
109109resource "oci_core_route_table" "public_route_table" {
110110 count = var. use_existing_vcn ? 0 : 1
111- compartment_id = var. targetCompartment
111+ compartment_id = var. vcn_compartment
112112 vcn_id = oci_core_vcn. vcn [0 ]. id
113113 display_name = " ${ local . cluster_name } _public_route_table"
114114
@@ -122,7 +122,7 @@ resource "oci_core_route_table" "public_route_table" {
122122resource "oci_core_route_table" "private_route_table" {
123123 count = var. use_existing_vcn ? 0 : 1
124124 display_name = " ${ local . cluster_name } _private_route_table"
125- compartment_id = var. targetCompartment
125+ compartment_id = var. vcn_compartment
126126 vcn_id = oci_core_vcn. vcn [0 ]. id
127127
128128 route_rules {
@@ -142,7 +142,7 @@ resource "oci_core_subnet" "public-subnet" {
142142 count = var. use_existing_vcn ? 0 : 1
143143 # availability_domain = var.ad
144144 vcn_id = oci_core_vcn. vcn [0 ]. id
145- compartment_id = var. targetCompartment
145+ compartment_id = var. vcn_compartment
146146 cidr_block = trimspace (var. public_subnet )
147147 security_list_ids = [oci_core_security_list . public-security-list [0 ]. id ]
148148 dns_label = " public"
@@ -154,7 +154,7 @@ resource "oci_core_subnet" "private-subnet" {
154154 count = var. use_existing_vcn ? 0 : 1
155155 # availability_domain = var.ad
156156 vcn_id = oci_core_vcn. vcn [0 ]. id
157- compartment_id = var. targetCompartment
157+ compartment_id = var. vcn_compartment
158158 cidr_block = trimspace (var. private_subnet )
159159 security_list_ids = [oci_core_security_list . internal-security-list [0 ]. id ]
160160 dns_label = " private"
0 commit comments