Skip to content

Commit 7b377e2

Browse files
committed
oci networking refactor and moved to external
Signed-off-by: junior <junior@users.noreply.github.com>
1 parent 2236f1c commit 7b377e2

File tree

1 file changed

+7
-35
lines changed

1 file changed

+7
-35
lines changed

module-oci-networking.tf renamed to oci-networking.tf

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
# File Version: 0.8.0
66

77
# Dependencies:
8-
# - module-defaults.tf file
8+
# - defaults.tf file
99
# - local.create_new_vcn
1010
# - local.create_subnets
1111
# - local.resolved_vcn_compartment_ocid
1212
# - local.subnets
1313
# - local.route_tables
1414
# - local.security_lists
15+
# - terraform-oci-networking module
1516

1617
################################################################################
1718
#
@@ -23,7 +24,7 @@
2324
# Module: Virtual Cloud Network (VCN)
2425
################################################################################
2526
module "vcn" {
26-
source = "./modules/oci-networking/modules/vcn"
27+
source = "github.com/oracle-quickstart/terraform-oci-networking//modules/vcn?ref=0.2.0"
2728

2829
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
2930
compartment_ocid = local.vcn_compartment_ocid
@@ -46,7 +47,7 @@ module "vcn" {
4647
################################################################################
4748
module "subnets" {
4849
for_each = { for map in local.subnets : map.subnet_name => map }
49-
source = "./modules/oci-networking/modules/subnet"
50+
source = "github.com/oracle-quickstart/terraform-oci-networking//modules/subnet?ref=0.2.0"
5051

5152
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
5253
compartment_ocid = local.vcn_compartment_ocid
@@ -73,7 +74,7 @@ module "subnets" {
7374
# Module: Gateways
7475
################################################################################
7576
module "gateways" {
76-
source = "./modules/oci-networking/modules/gateways"
77+
source = "github.com/oracle-quickstart/terraform-oci-networking//modules/gateways?ref=0.2.0"
7778

7879
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
7980
compartment_ocid = local.vcn_compartment_ocid
@@ -107,7 +108,7 @@ module "gateways" {
107108
################################################################################
108109
module "route_tables" {
109110
for_each = { for map in local.route_tables : map.route_table_name => map }
110-
source = "./modules/oci-networking/modules/route_table"
111+
source = "github.com/oracle-quickstart/terraform-oci-networking//modules/route_table?ref=0.2.0"
111112

112113
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
113114
compartment_ocid = local.vcn_compartment_ocid
@@ -128,7 +129,7 @@ module "route_tables" {
128129
################################################################################
129130
module "security_lists" {
130131
for_each = { for map in local.security_lists : map.security_list_name => map }
131-
source = "./modules/oci-networking/modules/security_list"
132+
source = "github.com/oracle-quickstart/terraform-oci-networking//modules/security_list?ref=0.2.0"
132133

133134
# Oracle Cloud Infrastructure Tenancy and Compartment OCID
134135
compartment_ocid = local.vcn_compartment_ocid
@@ -145,35 +146,6 @@ module "security_lists" {
145146
ingress_security_rules = each.value.ingress_security_rules
146147
}
147148

148-
################################################################################
149-
# OCI Network - VCN Variables
150-
################################################################################
151-
variable "create_new_vcn" {
152-
default = true
153-
description = "Creates a new Virtual Cloud Network (VCN). If false, the VCN must be provided in the variable 'existent_vcn_ocid'."
154-
}
155-
variable "existent_vcn_ocid" {
156-
default = ""
157-
description = "Using existent Virtual Cloud Network (VCN) OCID."
158-
}
159-
variable "existent_vcn_compartment_ocid" {
160-
default = ""
161-
description = "Compartment OCID for existent Virtual Cloud Network (VCN)."
162-
}
163-
variable "vcn_cidr_blocks" {
164-
default = "10.20.0.0/16"
165-
description = "IPv4 CIDR Blocks for the Virtual Cloud Network (VCN). If use more than one block, separate them with comma. e.g.: 10.20.0.0/16,10.80.0.0/16. If you plan to peer this VCN with another VCN, the VCNs must not have overlapping CIDRs."
166-
}
167-
variable "is_ipv6enabled" {
168-
default = false
169-
description = "Whether IPv6 is enabled for the Virtual Cloud Network (VCN)."
170-
}
171-
variable "ipv6private_cidr_blocks" {
172-
default = []
173-
description = "The list of one or more ULA or Private IPv6 CIDR blocks for the Virtual Cloud Network (VCN)."
174-
}
175-
176149
locals {
177-
vcn_cidr_blocks = split(",", var.vcn_cidr_blocks)
178150
vcn_compartment_ocid = var.create_new_vcn ? local.resolved_vcn_compartment_ocid : var.existent_vcn_compartment_ocid
179151
}

0 commit comments

Comments
 (0)