Dropping groups, roles, and users
At times, if you want to delete the group that you created, you can use the Remove-IAMGroup
cmdlet. In order to drop the group, you need to ensure that there are no attached policies or users assigned to the group:
PS C:\> Remove-IAMUserFromGroup -GroupName developer -UserName Ramesh PS C:\> Remove-IAMGroup -GroupName developer
For the AWS role deletion, you can use the Remove-IAMRole
cmdlet. The role must not have any policies attached. The following example deletes the role named WorldPressAppRole
from the current IAM account. Before you can delete the role, you must first use the Unregister-IAMRolePolicy
command to detach any managed policies. Inline policies are also deleted with the role.
PS C:\> Remove-IAMRole -RoleName WorldPressAppRole
To delete the specific IAM user from your AWS account, you can use the Remove-IAMUser
cmdlet. The user you are deleting must not belong to any groups or have any access keys, signing certificates, or attached...