Migrate providers from the legacy hashicorp/oci
source configuration to oracle/oci
.
The required_providers
block of a Terraform configuration file might use the legacy hashicorp/oci
source configuration.
Example:
terraform {
required_providers {
oci = {
source = "hashicorp/oci"
version = "4.55.0"
}
}
}
This legacy hashicorp/oci
source configuration won't be supported in the future.
Migrate any legacy source configuration to the current oracle/oci
source configuration.
-
Update the
required_providers
block in the Terraform configuration.
Example:
terraform {
required_providers {
oci = {
source = "oracle/oci"
}
}
}
To specify a version, add a version
line.
Example (version 4.55.0):
terraform {
required_providers {
oci = {
source = "oracle/oci"
version = "4.55.0"
}
}
}
-
If you use modules, then add the following block to each module.
terraform {
required_providers {
oci = {
source = "oracle/oci"
}
}
}
To specify a version, add a version
line (see example in previous step).
For information on providers in modules, see Providers Within Modules.
-
Run
terraform init
.
The state of the migration attempt is indicated by the response:
-
If the migration failed, then do the following:
-
Run
terraform state replace-provider -auto-approve hashicorp/oci oracle/oci
.
-
Run
terraform init
.