IAM: Allows managing a group's membership programmatically and in the console - Amazon Identity and Access Management
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

IAM: Allows managing a group's membership programmatically and in the console

This example shows how you might create an identity-based policy that allows updating the membership of the group called MarketingTeam. This policy defines permissions for programmatic and console access. To use this policy, replace the italicized placeholder text in the example policy with your own information. Then, follow the directions in create a policy or edit a policy.

What does this policy do?

  • The ViewGroups statement allows the user to list all the users and groups in the Amazon Web Services Management Console. It also allows the user to view basic information about the users in the account. These permissions must be in their own statement because they do not support or do not need to specify a resource ARN. Instead the permissions specify "Resource" : "*".

  • The ViewEditThisGroup statement allows the user to view information about the MarketingTeam group, and to add and remove users from that group.

This policy does not allow the user to view or edit the permissions of the users or the MarketingTeam group.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "ViewGroups", "Effect": "Allow", "Action": [ "iam:ListGroups", "iam:ListUsers", "iam:GetUser", "iam:ListGroupsForUser" ], "Resource": "*" }, { "Sid": "ViewEditThisGroup", "Effect": "Allow", "Action": [ "iam:AddUserToGroup", "iam:RemoveUserFromGroup", "iam:GetGroup" ], "Resource": "arn:aws-cn:iam::*:group/MarketingTeam" } ] }