Getting a Stack's Terraform Configuration

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


For stacks created from Terraform configurations in Git, configuration files aren't available for download until a job is successfully run on the stack.

Alternatively, you can view the generated Terraform configuration file in Code Editor. For more information, see Editing a Configuration Using Code Editor.

    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, next to Terraform configuration, click Download.
  • Use the oci resource-manager stack get-stack-tf-config command and required parameters to get a stack's Terraform configuration file.

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

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

  • Use the GetStackTfConfig operation to get a stack's Terraform configuration file.