Creating a Plan Job

Create a plan job in Resource Manager.

Creating (running) a plan job parses your Terraform configuration and converts it into an execution plan for the associated stack. The execution plan lists the sequence of specific actions planned to provision your Oracle Cloud Infrastructure resources, including actions that are expected after running an apply job. We recommend running a plan job (generating an execution plan) before running an apply job. The execution plan is handed off to the apply job, which then executes the instructions.

For configurations stored in a source code control system, such as GitHub or GitLab, the job uses the most recent commit.

    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, click Plan.
    5. (Optional) In the Plan panel, edit the default name for the job. Avoid entering confidential information.
    6. To retrieve the latest versions available from the configured source of Terraform providers, click Show advanced options and select Upgrade provider versions.
      The stack must be Terraform 0.14 or later, and if the stack is older, it must be upgraded to use Terraform Registry.This step is required if provider versions in the Terraform configuration changed since the last time a job was run on the stack. Dependency lock files are automatically managed for new and updated stacks. Providers are updated within the version constraints of the Terraform configuration.
    7. To generate detailed log content for debugging, click Show advanced options and select the log level that you want from Detailed log level.
      For more information, see Debugging Terraform.
    8. To adjust the maximum number of concurrent operations as Terraform walks the graph, click Show advanced options and edit the value for Maximum number of parallel operations. (Default: 10.) Use this option to speed up the job.

      A high value might cause throttling of resources. For example, consider a Terraform configuration that defines hundreds of compute instances. An Apply job attempts to create as many instances as possible at the same time. In this example, a value of 100 might cause throttling by the Compute service.
    9. To fetch the latest state before running the job, click Show advanced options and select Refresh resource states before checking for differences.

      Use this option to refresh the state first. For example, consider using this option with an Apply job that you intend to run on manually updated (existing) infrastructure.


      Refreshing the state can affect performance. If the configuration includes several resources, consider not using this option.
    10. (Optional) Click Show advanced options and assign tags to the job.
      • Tag namespace: To add a defined tag, select an existing namespace. To add a free-from tag, leave the value blank.
      • Tag key: To add a defined tag, select an existing tag key. To add a free-form tag, type the key name that you want.
      • Tag value: Type the tag value that you want.
      • Add tag: Click to add another tag.
    11. Click Plan.

    The plan job is created. The new job is listed under Jobs.

  • Use the oci resource-manager job create-plan-job command and required parameters to run a plan job.

    oci resource-manager job create-plan-job [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Resource Manager.

  • Use the CreateJob operation to create a plan job.

    For an example of the operation part of the request, see CreatePlanJobOperationDetails.