Updating a Stack's Terraform Configuration (Zip File or Folder)

Update the zip file or folder Terraform configuration used by a stack in Resource Manager. The updated configuration is used when you run jobs on the stack. A folder-based update is available using the Console only.

Before You Begin

Review prerequisites for updating the Terraform configuration used by a stack in Resource Manager.

Important

If you're uploading a different Terraform configuration, ensure that the configuration file is valid. See Authoring Configurations and Terraform Configurations for Resource Manager.

Ensure that you have your revised Terraform configuration (.zip file or folder) ready for upload. No configuration file is available for download until a job is successfully run on the stack. To edit a Terraform configuration that was generated from a template or existing compartment using resource discovery, first download the configuration. Then use the edited configuration .zip file for the update.

If the stack's configuration is stored in Git or a bucket, then upload the configuration there.

  • Tip

    As an alternative to these steps, edit the generated Terraform configuration file in Code Editor. For more information, see Editing a Configuration Using Code Editor.

    After completing all the prerequisites, follow these steps in the Console to update a stack's Terraform configuration from a zip file or folder.

    1. On the Stacks list page, find the stack that you want to work with. If you need help finding the list page or the stack, see Listing Stacks.
    2. From the Actions menu (Actions Menu) for the stack, select Edit.
    3. On the Edit stack page, select Folder or .Zip file and add the revised Terraform configuration.
      You can either drag the file onto the dialog's control or select Browse and navigate to the location of the file or folder.
    4. (Optional) Update other values as needed.
      For example, update the stack name or description. For information about the fields, see Creating a Stack from a Zip File.
    5. Select Next.
    6. In the Configure variables panel, update variable values as needed.
    7. Select Next.
    8. In the Review panel, verify the stack configuration.
    9. To automatically provision resources on creation of the stack, select Run apply.
    10. Select Save changes.

    The Stack details page opens.

    If Run apply was selected, then Resource Manager runs the apply action on the updated stack.

  • Use the oci resource-manager stack update command and required parameters to update the Terraform configuration zip file used by a stack.

    oci resource-manager stack update --config-source <file-path> [...]

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

  • Use the UpdateStack operation to update the Terraform configuration zip file used by a stack.

    For an example of the configSource part of the request, see UpdateZipUploadConfigSourceDetails.