How to automate OCI with Terraform

Lesson 1 – VCN, Subnet and Single Webserver

In this lesson you will create the simplest set of OCI resources, starting with one compartment, one VCN, and one subnet in this VCN. The subnet will be regional (covering all availability domains AD1-AD3). Inside this public subnet, we will nest one VM for Webserver. Public subnet means that VM will have public IP associated – VM will be exposed to the public Internet (via Internet Gateway and proper route table). After this deployment, one basic Security List will permit access from the public Internet to VM via protocol SSH (port 22) & HTTP/HTTPS protocols (port 80, 443). For the software provisioning, we will utilize null_resource and remote-exec capability of Terraform Null Provider – Terraform will install the HTTP server with root webpage content. As a consequence, after successful terraform apply, we should be able to visit VM public IP address with our web browser and expect their simple webpage content – Welcome to! This is WEBSERVER1…


Here is GitHub repo where you can download the code for this lesson.

Leave a Reply

4 thoughts on “How to automate OCI with Terraform

  1. Didn’t see anything that course has a time limit to complete. Not possible to complete this course in that time wouldn’t have signed up if that was case

    1. This is LearnPress timer which will reach zero, but the course will be still available (lifetime access). I am working on disabling this feature which is misleading.

Comments are closed.