💾 Archived View for cfdocs.wetterberg.nu › stackinstances-delete.gemini captured on 2024-08-25 at 01:59:36. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
Delete stack instances from your stack set
Search
You can delete stack instances from a stack set in either the AWS Management Console, or by using AWS CloudFormation commands in the AWS CLI. In this procedure, we will delete all stacks.
For a stack set with service-managed permissions, if you delete stack instances from a top-level organizational unit (OU), the OU is removed as a target of the stack set.
- Delete stack instances using the AWS Management Console
- Delete stack instances using the AWS CLI
Delete stack instances using the AWS Management Console
- Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation.
- Choose StackSets from the navigation pane. On the StackSets page, select the stack set that you created in Create a stack set.
- With the stack set selected, choose Delete stacks from StackSet from the Actions menu.[Choose Delete stacks from StackSet from the Actions menu.]
- On the Set deployment options page, choose the accounts from which to delete stack instances.[Self-managed permissions] For Accounts, choose Deploy stacks in accounts. Paste your target account numbers in the text box, separating multiple numbers with commas.[Service-managed permissions] For Accounts, choose Deploy stacks in organizational units. Paste the IDs of the OUs that your stack set targets.NoteStackSets also deletes stack instances from any child OUs of the specified target OUs.[Select the organizational units from which to delete stack instances.]For Deployment regions, choose the Regions from which you want to delete stack instances. In this case, US East (N. Virginia) Region and US West (Oregon) Region.For Deployment options:For Maximum concurrent accounts, keep the default values of Number and 1.For Failure tolerance, keep the defaults of Number and 0.In the Retain stacks area, keep the default setting of disabled.When you are deleting stacks from a stack set, the Retain stacks option lets you choose to remove the stack instances from your stack set, but save the stacks and their associated resources. When you save stacks from a stack set by choosing the Retain stacks option, the stack's resources stay in their current state, but the stack is no longer part of the stack set. You cannot reassociate a retained stack, or add an existing, saved stack to a new stack set. The stack is permanently independent of a stack set. In this procedure, we are deleting all stacks in preparation for deleting the entire stack set, so we are not retaining stacks.Choose Next.
- On the Review page, review your choices and choose Submit.
- After stack deletion is finished, you can verify that stack instances were deleted from your stack set in the StackSet detail page, on the Stack instances tab.[Use the Stack instances tab of the stack set details page to view information on your stack instances.]
https://console.aws.amazon.com/cloudformation
Create a stack set
Delete stack instances using the AWS CLI
- Run the delete-stack-instances command. For --stack-set-name, specify the stack set name my-awsconfig-stackset.Set the failure tolerance and maximum concurrent accounts by setting FailureToleranceCount to 0, and MaxConcurrentCount to 1 in the --operation-preferences parameter, as shown in the following example. To apply percentages instead, use FailureTolerancePercentage or MaxConcurrentPercentage. For the purposes of this walkthrough, we are using count, not percentage.NoteThe value of MaxConcurrentCount is dependent on the value of FailureToleranceCount. MaxConcurrentCount is at most one more than FailureToleranceCount.Because --retain-stacks is a required parameter of delete-stack-instances, if you do not want to retain (save) stacks, add --no-retain-stacks. In this walkthrough, we add the --no-retain-stacks parameter, because we are not retaining any stacks.[Self-managed permissions] Replace account_ID with the accounts you used to create your stack set in Create a stack set.[Service-managed permissions] For --deployment-targets, specify the organization (root) ID or OU IDs in which you created stack instances.NoteStackSets also deletes stack instances from any child OUs of the specified target OUs.
- Optionally, after stack deletion is finished, verify that stack instances were deleted from your stack set by running the describe-stack-set-operation command to show the status and results of the delete stacks operation. For --operation-id, use the operation ID that was returned by your delete-stack-instances command.
Create a stack set