Getting Started with the Terraform Provider
This topic provides instructions for downloading and installing both Terraform and the Oracle Cloud Infrastructure Terraform provider, and provides a brief introduction to the key concepts for understanding and using the Oracle Cloud Infrastructure Terraform provider.
Terraform is "infrastructure-as-code" software that allows you to define your infrastructure resources in files that you can persist, version, and share. These files describe the steps required to provision your infrastructure and maintain its desired state; it then executes these steps and builds out the described infrastructure.
Terraform’s configuration and execution building blocks are modules, which are self-contained configuration packages. You can use these modules to organize your code and to create reusable components. HashiCorp, the developer of Terraform, provides a library of open-source Terraform modules “out of the box” to support many common tasks.
To use Terraform for Oracle Cloud Infrastructure, you must download two components - Terraform from HashiCorp, and then the Oracle Cloud Infrastructure Terraform provider.
Download and Install Terraform
Download Terraform from the HashiCorp download page. Ensure that you download the correct binary file for your system.
The Oracle Cloud Infrastructure Terraform provider version 2.2.0 and greater requires Terraform version 0.10.1 or greater.
Download the Oracle Cloud Infrastructure Terraform Provider
Prerequisites for Installing and Using the Terraform Provider
- An Oracle Cloud Infrastructure account that has user credentials sufficient to execute a Terraform plan.
- A user in that account.
- Required keys and Oracle Cloud Infrastructure IDs (OCIDs). For guidance, see Required Keys and OCIDs.
- The correct Terraform binary file for your operating system (version 0.10.1 or greater).
Installing and Configuring the Terraform Provider
Installing Terraform and the Terraform Provider with Yum
If you're running Oracle Linux 7, you can use yum to install Terraform and the Terraform provider.
To use yum to install Terraform:
sudo yum install terraform
To use yum to install the Terraform provider:
sudo yum install terraform-provider-oci