Getting a Stack's State File

Download the Terraform state file used by a stack in Resource Manager. The Terraform state file for a stack is the one associated with the most recent successful job.

  • The Terraform state file listed on the stack details page is the same as the Terraform state file listed on the job details page for the most recent successful job.
    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, under Resources, click View state.
    5. To download the stack's state file, go to More actions and select Download Terraform state.
  • Use the oci resource-manager stack get-stack-tf-state command and required parameters to get the Terraform state file for a stack.

    oci resource-manager stack get-stack-tf-state --stack-id <stack_OCID> --file <file_name>

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

  • Use the GetStackTfState operation to get the Terraform state file for a stack.