Adding or Removing a User from a Group

You can add a user to a group and remove it at any time. A user can belong to several groups at the same time, and there is no limit to the number of users in a group.

You can then add an inline policy or attach a managed policy to the group, which is applied to all its users.

Adding or Removing a User Using OSC CLI

Adding a User to a Group

See the AddUserToGroup command sample in the documentation of the EIM API.

Removing a User from a Group

See the RemoveUserFromGroup command sample in the documentation of the EIM API.

Adding or Removing a User Using AWS CLI

Adding a User to a Group

To add a user to a group, use the add-user-to-group command following this syntax:

Request sample
$ aws iam add-user-to-group \
    --profile YOUR_PROFILE \
    --group-name GROUP_NAME \
    --user-name USER_NAME \
    --endpoint https://eim.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • group-name: The name of the group you want to add a user to.

  • user-name: The name of the user you want to add to the group.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The specified user is added to the specified group.

Removing a User from a Group

To remove a user from a group, use the remove-user-from-group command following this syntax:

Request sample
$ aws iam remove-user-from-group \
    --profile YOUR_PROFILE \
    --group-name GROUP_NAME \
    --user-name USER_NAME \
    --endpoint https://eim.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • group-name: The name of the group you want to remove a user from.

  • user-name: The name of the user you want to remove from the group.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The user is removed from the specified group.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.