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.
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.
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.
- Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.
- On the Stacks page, select the compartment that contains the stack that you want.
- Click the name of the stack that you want.
- On the Stack details page, next to Terraform configuration, click Upload.
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.
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.
- Click Next.
- In the Configure variables panel, update variable values as needed.
- Click Next.
- In the Review panel, verify the stack configuration.
- To automatically provision resources on creation of the stack, select Run apply.
- Click Save changes.
The Stack details page opens.
If Run apply was selected, then Resource Manager runs the apply action on the updated stack.
oci resource-manager stack updatecommand 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 flags and variable options for CLI commands, see the Command Line Reference for Resource Manager.