Build, change, and destroy a virtual cloud network and subnet on Oracle Cloud Infrastructure (OCI) using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
Install Terraform on Mac, Linux, or Windows by downloading the binary or using a package manager (Homebrew or Chocolatey). Then create a Docker container locally by following a quick-start tutorial to check that Terraform installed correctly.
Authenticate to Oracle Cloud Infrastructure, and create a Virtual Cloud Network. Write, format and validate a Terraform configuration. Plan and apply the configuration to create an VCN OCI resource.
Add a subnet to your Oracle Cloud Infrastructure (OCI) VCN. Modify the subnet display name and plan changes to update the resource in place. Learn how Terraform handles infrastructure change management.
Destroy the Oracle Cloud Infrastructure (OCI) Virtual Cloud Network (VCN) and subnet you created in the previous tutorials. Evaluate the plan and confirm the destruction.
Declare your OCI region and compartment ID as variables. Reference the variable in Terraform configuration. Define variables using .tfvars files or default values.
Declare output values to display the status and CIDR block of your OCI VCN. Display all outputs and query specific outputs. Define what data stored in Terraform state is relevant to the operator or end user.