Delete a stack set using the CloudFormation console or AWS CLI
To delete a stack set, you must first delete all stack instances in the stack set. For information about how to delete all stack instances, see Delete stack instances from your stack set.
Delete a stack set using the CloudFormation console
Sign in to the AWS Management Console and open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation
. -
On the navigation bar at the top of the screen, choose the AWS Region you created the stack set in.
-
On the StackSets page, select the stack set.
-
With the stack set selected, choose Delete StackSet from the Actions menu.
-
When you are prompted to confirm that you want to delete the stack set, choose Delete StackSet.
Delete a stack set using the AWS CLI
When acting as a delegated administrator, you must set the --call-as
option to DELEGATED_ADMIN
each time you run a StackSets
command.
--call-as
DELEGATED_ADMIN
-
Use the following delete-stack-set command. When you are prompted to confirm, type
y
, and then press Enter.aws cloudformation delete-stack-set --stack-set-name
my-stackset
-
Verify that the stack set was deleted by running the list-stack-sets command. The results of the list-stack-sets command should show your stack with a status of
DELETED
.aws cloudformation list-stack-sets
Delete service roles (optional)
If you no longer need the IAM service roles that CloudFormation requires to perform stack set operations, we recommend that you delete the roles.
For self-managed stack sets, the roles you created. For more information about these roles, see Grant self-managed permissions.
For service-managed stack sets, the roles that
were automatically created by StackSets have the suffix
CloudFormationStackSetsOrgAdmin
in the organization
management account, and CloudFormationStackSetsOrgMember
in each target
account. For more information about these roles, see Activate trusted access for stack sets with
Organizations.
For more information about deleting roles, see Delete roles or instance profiles in the IAM User Guide.
To delete a service role (console)
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
. -
From the navigation pane, choose Roles, and then fill the check box next to the role that you want to delete.
-
In the Role actions menu at the top of the page, choose Delete role.
-
In the confirmation dialog box, choose Yes, Delete. If you are sure, you can proceed with the deletion even if the service last accessed data is still loading.
To delete a service role (AWS CLI)
-
Use the following delete-role command. When you are prompted to confirm, type
y
, and then press Enter.aws iam delete-role --role-name
role name