Terraform, the Oracle Cloud Infrastructure (OCI) Terraform provider, and Terraform modules all have the ability to introduce changes or add new functionality.
Terraform Updates
Review major Terraform releases for changes in behavior when upgrading.
Terraform v0.14 🔗
The Oracle Cloud Infrastructure (OCI) Terraform provider now supports Terraform v0.14.
Terraform v0.14 changes the output of the terraform plan command and introduces a dependency lock file you can use to track the version of the (OCI) Terraform provider used to interact with your OCI resources.
To reduce the verbosity of terraform plan output, Terraform output now omits any attribute that hasn't changed, except for some attributes whose values often contain human-recognizable identifying information.
You can temporarily reenable verbose output by setting the environment variable TF_X_CONCISE_DIFF=0 when you run Terraform.
Sensitive values in Terraform plan output 🔗
Because Terraform v0.14 tracks expressions whose result is derived from a sensitive input variable or sensitive output value, you might find that more values are obscured in the terraform plan output than would have been in earlier versions. For more information, see sensitive — Suppressing Values in CLI Output and Suppressing Values in CLI Output.
If a different module uses a value in its output that was derived from a sensitive variable or value, you must set sensitive = true in the output of the second module.
Provider dependency lock file 🔗
In Terraform v0.13 and earlier, the terraform init command would always install the newest version of any provider in the configuration that would meet the configured version constraints. To keep the behavior of an already tested configuration as stable as possible unless intentionally changed by the user, Terraform v0.14 introduces a new dependency lock file.
Terraform generates this file automatically after running terraform init in the same directory as the configuration's root module. The dependency lock file includes the specific version numbers selected for each provider, including the OCI Terraform provider. After running terraform init for the first time after upgrading to Terraform v0.14, a new file .terraform.lock.hcl appears in the root module directory. Future initializations of Terraform automatically read and respect the entries in that file.
Because of this new feature, manually placing extra plugins into the local cache directory .terraform/plugins is no longer effective.
Terraform v0.12 🔗
If upgrading to Terraform v0.12, the Oracle Cloud Infrastructure (OCI) Terraform provider and some existing configurations might need to be updated as well.
Terraform provider releases might include changes in behavior you should consider when upgrading.
Registry and Namespace Change 🔗
The Oracle Cloud Infrastructure (OCI) Terraform provider is moving.
The Terraform provider has moved from the shared github.com/terraform-providers repository and is now published on the public Oracle repository.
If the provider returns the following warning, update the configuration and state files to reflect the accompanying namespace change:
The remote registry returned warnings for registry.terraform.io/hashicorp/oci:
- For users on Terraform 0.13 or greater, this provider has moved to
oracle/oci. Please update your source in required_providers.
Update provider blocks 🔗
If you're using Terraform v0.13, you can update the required_providers block to include a source value of oracle/oci instead of the legacy hashicorp/oci value. For example:
To replace the provider in existing Terraform state files, you must run terraform state replace-provider . For example:
Command
CopyTry It
terraform state replace-provider 'registry.terraform.io/-/oci' 'registry.terraform.io/hashicorp/oci'
Example response:
Terraform will perform the following actions:
~ Updating provider
- registry.terraform.io/-/oci
+ registry.terraform.io/hashicorp/oci
Changing 4 resources:
oci_core_subnet.this
data.oci_identity_availability_domains.this
oci_core_default_route_table.this
oci_core_internet_gateway.this
Do you want to make these changes?
Only 'yes' will be accepted to continue.
Enter a value:
If you enter yes, then the expected response is "Successfully replaced provider for n resources." (n is the number of resources affected)