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.

Note

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. 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. Next to Terraform configuration, select 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.