Upgrading Configurations to Terraform v0.12

Upgrade OCI Terraform provider configurations for Terraform v0.12.

With the release of Terraform v0.12, Oracle Cloud Infrastructure Terraform providers need to be upgraded and some existing configurations might need to be updated as well.

Upgrading the Terraform Provider

Oracle Cloud Infrastructure (OCI) Terraform provider versions 3.26.0 and below are not compatible with Terraform v0.12. OCI Terraform provider version 3.27.0 is the earliest version that supports Terraform v0.12.

Note

All OCI Terraform provider versions remain compatible with Terraform v0.11 and v0.10.
The simplest way to begin using the latest v0.12-compatible provider from the HashiCorp provider registry is to place an explicit version requirement in your provider configuration block, as shown here:
provider "oci" {
  version          = ">= 3.27.0"
  region           = "${var.region}"
  tenancy_ocid     = "${var.tenancy_ocid}"
  user_ocid        = "${var.user_ocid}"
  fingerprint      = "${var.fingerprint}"
  private_key_path = "${var.private_key_path}"
}

For guidance using additional version configuration options, see Provider Versions.

Upgrading Terraform Configurations

Some users may find that no changes are needed to run existing Terraform configurations with v0.12.

For configurations that do need to be upgraded, see Upgrading Terraform configuration.

Upgrading configurations while preserving v0.11 compatibility

As recommended in Upgrading Terraform configuration, the simplest way to upgrade your configurations is to use the terraform 0.12upgrade command. Using the terraform 0.12upgrade command to upgrade your configurations, however, renders them incompatible with Terraform v0.11 and earlier.

Caution

Prior to making configuration changes, it is strongly recommended that configuration and state files are backed up using version control or another preferred mechanism.

It may be possible to manually upgrade configurations to work with v0.12 while preserving compatibility with v0.11. Not all possible configurations can be made compatible with both v0.11 and v0.12. This method should only be used as a best-effort to preserve compatibility with v0.11.

The following cases detail where it is possible to convert existing v0.11 usage to be compatible with both v0.11 and v0.12.