Retrieving the Latest Providers
Within the version constraints of the Terraform configuration, retrieve the latest versions available from the configured source of Terraform providers when running a job. You can retrieve the latest providers when running the following types of jobs: plan, apply, destroy, import state, and run drift detection.
When retrieving latest versions of providers for a job, Resource Manager automatically manages dependency lock files for the stack.
This step is required if provider versions in the Terraform configuration changed since the last time a job was run on the stack. Providers are updated within the version constraints of the Terraform configuration.
Before You Begin
Review prerequisites for retrieving the latest providers.
-
The stack must use Terraform version 0.14 or later
-
If the stack is older, then it must be upgraded to use Terraform Registry. See Using Terraform Registry with an Older Stack.
These steps show how to retrieve the latest providers for a job in a stack. You can also retrieve the latest providers for a job in a compartment. - On the Stacks list page, select the stack that you want to work with. If you need help finding the list page or the stack, see Listing Stacks.
- Select the option for running the type of job that you want.
- In the panel for the job type that you selected, select Show advanced options and select Upgrade provider versions.
- Run the job.
Use the command and required parameters for the type of job you want to run, and set
--job-operation-details-is-provider-upgrade-required
totrue
.For example, to retrieve the latest providers when running a plan job, use the
oci resource-manager job create-plan-job
command to run a plan job, with--job-operation-details-is-provider-upgrade-required
set totrue
.oci resource-manager job create-plan-job --stack-id <stack_ocid> --job-operation-details-is-provider-upgrade-required true
For a complete list of parameters and values for CLI commands, see the Command Line Reference for Resource Manager.
Use the CreateJob operation to retrieve the latest providers when running a job.
When defining CreateJobDetails, specify
jobOperationDetails
(CreateJobOperationDetails), settingisProviderUpgradeRequired
totrue
.