Installing the Provider

Install the OCI Terraform provider.

To use the Oracle Cloud Infrastructure (OCI) Terraform provider, you must install both Terraform and the OCI Terraform provider. You can directly download Terraform and the OCI Terraform provider from HashiCorp.

Government Cloud customers: follow the installation and configuration steps in Enabling FIPS Compatibility.

Tip

Use Resource Manager to preinstall the Oracle Cloud Development Kit on a compute instance in your compartment. The Oracle Cloud Development Kit includes Terraform and the OCI Terraform provider, and preconfigures the required authorization.

After downloading and installing, you must configure the Terraform provider so that Terraform can interact with OCI resources.

Prerequisites for Installing and Using the Provider

  • An Oracle Cloud Infrastructure (OCI) account that has the required user credentials to execute a Terraform plan.
  • A user in that account.
  • Required keys and OCI IDs (OCIDs). For guidance, see Required Keys and OCIDs.
  • The correct Terraform binary file for your OS. We recommend using Terraform version 0.12.20 or greater.

Installing from HashiCorp

Terraform and the OCI Terraform provider can be downloaded directly from HashiCorp.

Download and Install Terraform

Terraform is available for direct download from the HashiCorp download page. Ensure that you download the correct binary file for your system.

Download and Install the Provider

To use the latest version of the OCI Terraform provider, run terraform init from the directory that contains a configuration file with the provider "oci" { ... configuration block. The provider is automatically downloaded. Terraform configurations also allow you to specify a particular version of the OCI Terraform provider.

You can also download the Terraform provider directly to a location of your choice.

Test the Terraform Installation

Open a terminal window and run the following command to test your installation:

terraform -v