| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
You might want to delete a group that you no longer need. When you use the AWS Management Console to delete a group, IAM deletes the group and any associated policies, but leaves the users intact. If you use the IAM CLI or API to remove the group, you must remove the users and policies before you can remove the group.
When you use the console to remove a group, IAM removes any policies associated with the group, and it removes the group. Users are removed from the group, and permissions the users had because they belonged to the group will no longer apply to them.
The following diagram and table describe the general process for deleting a group.

Process for Deleting a Group from Your AWS Account
|
1 |
Remove all users from the group. |
|
2 |
Delete all policies attached to the group. |
|
3 |
Delete the group. |
How you actually execute the tasks in the preceding table depends on which interface you're using to access IAM. The interface-specific details are covered in the sections that follow.
If you're using the command line interface to access IAM, you can use a separate command for each of the tasks involved in deleting a group from your AWS account. Or, optionally, you can recursively delete the group and any attached policies by specifying an option with the command. The following table lists the commands to use. For more information about the commands, go to the AWS Identity and Access Management Command Line Interface Reference.
Process for Deleting a Group from Your AWS Account
|
1 |
Individually remove all users from the group:
|
|
2 |
Delete the policies attached to the
group: |
|
3 |
Delete the
group: This function works only when the users have been removed from the group,
and when the policies are no longer attached. If you want to delete
the group and all attached policies without first removing the users and policies,
use the |
If you're programmatically accessing IAM, you use a separate API call for each of the tasks involved in setting up a new user. The following table lists the API actions to use. Before deleting the group, you must delete all users from the group and remove any policies attached to it.
Process for Deleting a User from Your AWS Account
|
1 |
Remove all users from the group:
|
|
2 |
Delete all policies attached to the
group:
|
|
3 |
Delete the
group: |
For more information about the actions, go to the AWS Identity and Access Management API Reference, or refer to your SDK's documentation.