1
1
resource "oci_core_vcn" "vcn" {
2
2
count = var. use_existing_vcn ? 0 : 1
3
3
cidr_block = var. vcn_subnet
4
- compartment_id = var. targetCompartment
4
+ compartment_id = var. vcn_compartment
5
5
display_name = " ${ local . cluster_name } _VCN"
6
6
dns_label = " cluster"
7
7
}
8
8
9
9
resource "oci_core_security_list" "internal-security-list" {
10
10
count = var. use_existing_vcn ? 0 : 1
11
11
vcn_id = oci_core_vcn. vcn [0 ]. id
12
- compartment_id = var. targetCompartment
12
+ compartment_id = var. vcn_compartment
13
13
14
14
ingress_security_rules {
15
15
protocol = " all"
@@ -41,7 +41,7 @@ resource "oci_core_security_list" "internal-security-list" {
41
41
resource "oci_core_security_list" "public-security-list" {
42
42
count = var. use_existing_vcn ? 0 : 1
43
43
vcn_id = oci_core_vcn. vcn [0 ]. id
44
- compartment_id = var. targetCompartment
44
+ compartment_id = var. vcn_compartment
45
45
46
46
ingress_security_rules {
47
47
protocol = " all"
@@ -83,22 +83,22 @@ resource "oci_core_security_list" "public-security-list" {
83
83
resource "oci_core_internet_gateway" "ig1" {
84
84
count = var. use_existing_vcn ? 0 : 1
85
85
vcn_id = oci_core_vcn. vcn [0 ]. id
86
- compartment_id = var. targetCompartment
86
+ compartment_id = var. vcn_compartment
87
87
display_name = " ${ local . cluster_name } _internet-gateway"
88
88
}
89
89
90
90
resource "oci_core_nat_gateway" "ng1" {
91
91
count = var. use_existing_vcn ? 0 : 1
92
92
vcn_id = oci_core_vcn. vcn [0 ]. id
93
- compartment_id = var. targetCompartment
93
+ compartment_id = var. vcn_compartment
94
94
display_name = " ${ local . cluster_name } _nat-gateway"
95
95
}
96
96
97
97
98
98
resource "oci_core_service_gateway" "sg1" {
99
99
count = var. use_existing_vcn ? 0 : 1
100
100
vcn_id = oci_core_vcn. vcn [0 ]. id
101
- compartment_id = var. targetCompartment
101
+ compartment_id = var. vcn_compartment
102
102
display_name = " ${ local . cluster_name } _service-gateway"
103
103
104
104
services {
@@ -108,7 +108,7 @@ resource "oci_core_service_gateway" "sg1" {
108
108
109
109
resource "oci_core_route_table" "public_route_table" {
110
110
count = var. use_existing_vcn ? 0 : 1
111
- compartment_id = var. targetCompartment
111
+ compartment_id = var. vcn_compartment
112
112
vcn_id = oci_core_vcn. vcn [0 ]. id
113
113
display_name = " ${ local . cluster_name } _public_route_table"
114
114
@@ -122,7 +122,7 @@ resource "oci_core_route_table" "public_route_table" {
122
122
resource "oci_core_route_table" "private_route_table" {
123
123
count = var. use_existing_vcn ? 0 : 1
124
124
display_name = " ${ local . cluster_name } _private_route_table"
125
- compartment_id = var. targetCompartment
125
+ compartment_id = var. vcn_compartment
126
126
vcn_id = oci_core_vcn. vcn [0 ]. id
127
127
128
128
route_rules {
@@ -142,7 +142,7 @@ resource "oci_core_subnet" "public-subnet" {
142
142
count = var. use_existing_vcn ? 0 : 1
143
143
# availability_domain = var.ad
144
144
vcn_id = oci_core_vcn. vcn [0 ]. id
145
- compartment_id = var. targetCompartment
145
+ compartment_id = var. vcn_compartment
146
146
cidr_block = trimspace (var. public_subnet )
147
147
security_list_ids = [oci_core_security_list . public-security-list [0 ]. id ]
148
148
dns_label = " public"
@@ -154,7 +154,7 @@ resource "oci_core_subnet" "private-subnet" {
154
154
count = var. use_existing_vcn ? 0 : 1
155
155
# availability_domain = var.ad
156
156
vcn_id = oci_core_vcn. vcn [0 ]. id
157
- compartment_id = var. targetCompartment
157
+ compartment_id = var. vcn_compartment
158
158
cidr_block = trimspace (var. private_subnet )
159
159
security_list_ids = [oci_core_security_list . internal-security-list [0 ]. id ]
160
160
dns_label = " private"
0 commit comments