[ Part 2 ] Deploying the infrastructure

Steps to be implemented

  • initialize the working directory

  • determine what to be created

  • apply the changes

[ 1 ] Initialize the working directory

Perform this step by running the Terraform command, "terraform init"

zack@cloudshell:MdsReplication (eu-frankfurt-1)$  terraform init

[ 2 ] Determine what to be created/deployed

Perform this step by running the Terraform command, "terraform plan"

zack@cloudshell:MdsReplication (eu-frankfurt-1)$  terraform plan

[ 3 ] Apply changes

[ 3.1 ] Create the compartment

Perform this step to create the compartment, by applying resource targetting:

terraform apply -target oci_identity_compartment.MySqlOciCompartment

[ 3.2 ] Create the rest of resources

Perform this step by running the Terraform command, "terraform apply"

zack@cloudshell:MdsReplication (eu-frankfurt-1)$  terraform apply

At this stage, the "terraform apply" will be:

  • creating a VCN and compartment, with two subnets - private and public

  • creating an Internet Gateway

  • creating an Service Gateway

  • applying route rules for Service Gateway

  • deploying an OCI instance in a public subnet, with firewall rules for ports 22, 3306, 33060 and 3307

  • provisioning MySQL service and mysql-shell on OCI instance

  • creating a MySQL DB System in a private subnet, with a static private IP (10.0.1.5)

  • creating an Object Storage

The Channel will be created in Part 5. The below architecture represents the entire deployment.

Last updated