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.

  • 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.
    1. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.
    2. On the Stacks page, select the compartment that contains the stack that you want.
    3. Click the name of the stack that you want.
    4. On the Stack details page, select the option for running the type of job that you want.
    5. In the panel for the job type that you selected, click Show advanced options and select Upgrade provider versions.
    6. 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 to true.

    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 to true.

    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), setting isProviderUpgradeRequired to true.