6.1 Creating Network Components
First version of Terraform could create new network components but subsequent versions should allow use of existing VCN, Subnet, etc.
- Accept compartment as input. The above topology will be provisioned in compartment specified.
- Create a new VCN with CIDR block 10.0.0.0/16, for example,
ggsa-ha
. - Create an Internet Gateway, for example,
ggsa-ig
for VCNggsa-ha
. - Add a route rule to the VCN’s route table with the following attributes:
- Target Type = Internet Gateway
- Destination CIDR Block = 0.0.0.0/0
- Target Internet Gateway =
ggsa-ig
- Create a new public regional-subnet, for example,
your-vcn-name-public
, with CIDR block 10.0.0.0/24. - Create a new private regional-subnet, for example,
your-private-regional-subnet
, with CIDR block 10.0.1.0/24.