When an environment is no longer needed, delete the cloud stack with Oracle Cloud Stack in order to free up account resources.
Deleting a stack terminates all cloud resources that are components of the stack. Oracle Cloud Stack does not clean up any related resources that are not directly part of the stack. For example, if a stack resource is configured to use an existing object storage container for backups, these backups may not be deleted when the stack resource is deleted.
If a stack contains more than one resource, you must delete these resources with Oracle Cloud Stack. You cannot delete the resources individually from their respective service consoles or APIs.
Deleting a Cloud Stack with the Console
Use the web console to delete a cloud stack from Oracle Cloud Stack.
- Sign in to the Oracle Cloud Stack console and navigate to the Stacks page.
- Click the menu to the right of the stack you want to delete.
- Select Delete.
- Choose a value for Force service deletion:
- No (default) – If an error occurs while a resource in this stack is being deleted, the rest of the stack will not be deleted.
- Yes – The stack and all of its resources will be deleted, even if an error occurs during the delete operation.
- If any of the cloud resources in your stack support additional deletion parameters, you will be prompted to provide values for these parameters.
- Click Delete.
Deleting a Cloud Stack with the CLI
Use the CLI to delete a cloud stack from Oracle Cloud Stack.
- Execute the
stack deletecommand. Supply the name of the cloud stack:
psm stack delete -n name
If any of the resources in your stack support deletion parameters, use the
-coption to provide values for them.
By default, the stack and all of its resources will be deleted, even if an error occurs during the delete operation. If you specify the
-f falseoption and an error occurs while a resource in this stack is being deleted, the rest of the stack will not be deleted.
- The output of the
stack deletecommand includes a job ID number. Use the
stack operation-statuscommand to periodically check the state of the delete operation:
psm stack operation-status -j jobID
For more information about the CLI commands for Oracle Cloud Stack, see psm stack Commands.