| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Deletes a group from your AWS account. If using this command only with the -g option,
the group must be empty and have no attached policies.
If you want to delete the group, delete the users from the group, and delete its attached policies all at once,
you can use the -r option to recursively delete the group. Recursively deleting the group
automatically removes user associations from the group and deletes any
attached policies along with the group.
Important
Use the -r option with caution. Before performing a recursive delete, to ensure
you are not deleting anything you don't want to, use the -p option along with the -r
option to list all the users in the group and any attached policies without actually performing the recursive
deletion.
iam-groupdel -g
GROUPNAME
[ -r [-p] ]
| Name | Description | Required |
|---|---|---|
|
|
Name of the group to delete. Type: String Default: None |
Yes |
|
|
Removes any users from the group and deletes any attached policies while deleting the group. Type: String Default: None |
Optional |
|
|
Returns a list of associated users and policies, without actually deleting the
group. Use this before using Type: String Constraints: You can apply -p only together with -r. Default: None |
Optional |
If the deletion is successful, the output is empty.
The following example deletes the group called Test. This example assumes the group is empty and has no policies attached.
PROMPT> iam-groupdel -g TestThe following example shows the user associations and the policies that would be deleted if you were to recursively delete the Test group.
PROMPT> iam-groupdel -g Test -r -p
users
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Susan
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/John
policies
TestGroupPolicyThe following example recursively deletes the Test group.
PROMPT> iam-groupdel -g Test -r