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. 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.
    2. On the stack's details page, select Plan.
    3. (Optional) In the Plan panel, edit the default name for the job. Avoid entering confidential information.
    4. To retrieve the latest versions available from the configured source of Terraform providers, select 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.
    5. To generate detailed log content for debugging, select Show advanced options and select the log level that you want from Detailed log level.
      For more information, see Debugging Terraform.
    6. To adjust the maximum number of concurrent operations as Terraform walks the graph, select Show advanced options and edit the value for Maximum number of parallel operations. (Default: 10.) Use this option to speed up the job.
      Note

      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.
    7. To fetch the latest state before running the job, select 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.

      Note

      Refreshing the state can affect performance. If the configuration includes several resources, consider not using this option.
    8. (Optional) Select 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.
    9. Select 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.