Creating an Apply Rollback Job

Create an apply rollback job in Resource Manager.

When you create (run) an apply rollback job for a stack, Terraform provisions the resources and executes the action defined in the target job's Terraform configuration, applying the execution plan to the associated stack. This job rolls back your Oracle Cloud Infrastructure resources to a previous state.

We recommend creating (running) a plan rollback job (generating an execution plan) before running an apply rollback job, using the following flow.

  1. Identify the successful apply job that you want to roll back to.

    The job you want to roll back to is also known as the "target job."

  2. Create a plan rollback job for the target job.

  3. Confirm that the plan rollback job succeeded.

  4. Confirm that the generated execution plan meets expectations.

  5. Create an apply rollback job using the generated execution plan (executionPlanRollbackStrategy).

    Instructions are on this page.

What's Next

Depending on the number and type of resources specified, a given apply rollback job can take some time.

After running an apply rollback job, get the job's details to check its status. You can optionally view the Terraform state file, view the logs, and confirm existence of provisioned resources.

Monitor the job status (lifecycle state) by getting the job's details. Succeeded (SUCCEEDED) indicates that the job has completed. Depending on the complexity of the job, the operation can take some time. While the job runs, or after it finishes, you can get the job logs content.

To view the Terraform state file (shows the state of your resources after running the job), select the name of the job to display the Job details page, then select View state under Resources. Optionally select Show changes in this version.

To view the logs for the job, select the job to open its details page, then select Logs under Resources.

To confirm existence of newly provisioned resources, inspect resources in the compartment.

Was this article helpful?