Attaching a Managed Policy to a User or a Group

You can attach a managed policy to a user or a group. This policy is automatically applied to the individual user or to all the users in the group. You can attach up to two policies to a single user or group at the same time.

If you create several versions for a policy, the policy version set as the default one is applied. For more information, see Editing Managed Policies Using Policy Versions.

Attaching a Managed Policy to a User

Attaching a Managed Policy to a User Using Cockpit v2

Before you begin: Create a managed policy. For more information, see Creating a Managed Policy.

  1. Click inside the EIM Users dashboard to make checkboxes appear.

  2. Check the box of the user to which you want to attach a managed policy.
    The user is selected and an action menu appears.

  3. Click IconLink Link Policy.
    The LINK POLICY dialog box appears.

  4. From the Policy list, select one or more managed policies you want to attach to the user.

  5. Click Link.
    The managed policy is attached and applied to the user.

Attaching a Managed Policy to a User Using OSC CLI

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

Attaching a Managed Policy to a User Using AWS CLI

Before you begin: Create a managed policy. For more information, see Creating a Managed Policy.

To attach a managed policy to a user, use the attach-user-policy command following this syntax:

Request sample
$ aws iam attach-user-policy \
    --profile YOUR_PROFILE \
    --user-name USER_NAME \
    --policy-arn arn:aws:iam::123456789012:policy/MY_POLICY \
    --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.

  • user-name: The name of the user to which you want to attach the managed policy.

  • policy-arn: The OUTSCALE Resource Name (ORN) of the policy you want to attach.

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

The specified managed policy is attached and applied to the user.

Attaching a Managed Policy to a Group

Attaching a Managed Policy to a Group Using OSC CLI

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

Attaching a Managed Policy to a Group Using AWS CLI

Before you begin: Create a managed policy. For more information, see Creating a Managed Policy.

To attach a managed policy to a group, use the attach-group-policy command following this syntax:

Request sample
$ aws iam attach-group-policy \
    --profile YOUR_PROFILE \
    --group-name USER_NAME \
    --policy-arn arn:aws:iam::123456789012:policy/MY_POLICY \
    --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 to which you want to attach the policy.

  • policy-arn: The OUTSCALE Resource Name (ORN) of the policy you want to attach.

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

The specified managed policy is attached to the group, and applied to each user in the 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.