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. 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 Upload.
    5. On the Edit stack page, click Folder or .Zip file and add the revised Terraform configuration.
      You can either drag the file onto the dialog's control or click Browse and navigate to the location of the file or folder.
    6. (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.
    7. Click Next.
    8. In the Configure variables panel, update variable values as needed.
    9. Click Next.
    10. In the Review panel, verify the stack configuration.
    11. To automatically provision resources on creation of the stack, select Run apply.
    12. Click 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.