Getting the Terraform Output for a Plan Job

Download the output of a plan job in Resource Manager.

Note

To prevent errors caused by unavailable files, wait a second after the job finishes to download the job information. An error appears if the job information doesn't exist yet. For example, a 409 error appears if you attempt to download the Terraform configuration immediately after running a job. In this case, the Terraform configuration is still being copied to a location using a background process. The Terraform configuration is available about a second after the job finishes.
  • These steps show how to get plan output for a job in a compartment. You can also get plan output for a job in a stack.
    1. On the Jobs list page, select the job that you want to work with. If you need help finding the list page or the stack, see Listing Jobs.
    2. Select Download Terraform plan and then select the file format option you want (binary or JSON file).
  • Use the oci resource-manager job get-job-tf-plan command and required parameters to get the output of a plan job.

    oci resource-manager stack get-job-tf-plan --job-id <job_OCID> --file-id <file_name>

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

    Example Request

    Example to get the output of a plan job in JSON format:

    oci resource-manager job get-job-tf-plan --job-id ocid1.ormjob.oc1.phx.<uniqueid> --file tfplan.json --tf-plan-format JSON
  • Use the GetJobTfPlan operation to get the output of a plan job.