Listing Managed Policies

You can get the list of all the managed policies available for your account, or of managed policies attached to a user or a group.

If you exceed the number of identical requests allowed for a configured time period, the Throttling error message is returned.

Listing Your Managed Policies

This procedure uses AWS CLI only. Information about these resources is also available from Cockpit v1. For more information, see EIM User Interface > Policies Page.

To list the managed policies available for your account, use the list-policies command following this syntax:

Request sample
$ aws iam list-policies \
    --profile YOUR_PROFILE \
    --scope all \
    --only-attached \
    --path-prefix / \
    --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.

  • (optional) scope: The scope to filter the result (all | local).

    As no 3DS OUTSCALE-managed policies are provided, this action only returns policies you created independently from the scope you choose.

  • (optional) only-attached | not-only-attached: If only-attached is set, only managed policies that are attached to an EIM identity are listed.

  • (optional) path-prefix: The path prefix of the policies you want to describe (by default, set to a slash /).

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

The list-policies command returns the following elements:

  • Policies: Information about one or more policies. This element contains the following information:

    • PolicyName: The name of the policy.

    • CreateDate: The date and time of creation of the policy.

    • AttachmentCount: The number of EIM identities (users or groups) the policy is attached to.

    • IsAttachable: If true, the policy can be attached to an EIM identity. If false, it cannot.

    • PolicyId: The ID of the policy.

    • DefaultVersionId: The ID of the policy version set as the default one.

    • Path: The path for the policy.

    • Arn: The OUTSCALE Resource Name (ORN) of the policy.

    • UpdateDate: The date and time of the last update of the policy.

Result sample
{
        "Policies": [
        {
                "PolicyName": "AdminAccess",
                "CreateDate": "2016-05-12T18:43:524Z",
                "AttachmentCount": 5,
                "IsAttachable": true,
                "PolicyId": "ABCDEFGHIJKLMNO12PQRS",
                "DefaultVersionId": "v1",
                "Path": "/",
                "Arn": "arn:aws:iam::aws:policy/AdminAccess",
                "UpdateDate": "2016-05-12T18:43:524Z"
              },
        ]
}

Listing the Managed Policies Attached to a User

In Cockpit, the list of managed policies attached to a user is available on the Users page, when you click Detach Policy . For more information, see Detaching a Managed Policy from a User or a Group.

To list the managed policies attached to a user, use the list-attached-user-policies command following this syntax:

Request sample
$ aws iam list-attached-user-policies \
    --profile YOUR_PROFILE \
    --user-name Jane \
    --path-prefix / \
    --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.

  • (optional) path-prefix: The path prefix of the policies you want to list (by default, set to a slash /).

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

The list-attached-user-policies command returns the following elements:

  • AttachedPolicies: Information about one or more policies attached to the specified user. This element contains the following information:

    • PolicyName: The name of the policy.

    • PolicyArn: The OUTSCALE Resource Name (ORN) of the policy.

Result sample
{
  "AttachedPolicies": [
    {
      "PolicyName": "AdminAccess",
      "PolicyArn": "arn:aws:iam::aws:policy/AdminAccess"
    },
    {
      "PolicyName": "DevAccess",
      "PolicyArn": "arn:aws:iam::aws:policy/DevAccess"
    }
  ],
}

Listing the Managed Policies Attached to a Group

In Cockpit, the list of managed policies attached to a group is available on the Groups page, when you click Detach Policy . For more information, see Detaching a Managed Policy from a User or a Group.

To list the policies attached to a group, use the list-attached-group-policies command following this syntax:

Request sample
$ aws iam list-attached-group-policies \
    --profile YOUR_PROFILE \
    --group-name Dev \
    --path-prefix / \
    --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 user.

  • (optional) path-prefix: The path prefix of the policies you want to list (by default, set to a slash /).

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

The list-attached-user-policies command returns the following elements:

  • AttachedPolicies: Information about one or more policies attached to the specified group. This element contains the following information:

    • PolicyName: The name of the policy.

    • PolicyArn: The OUTSCALE Resource Name (ORN) of the policy.

Result sample
{
  "AttachedPolicies": [
    {
      "PolicyName": "DevAccess",
      "PolicyArn": "arn:aws:iam::aws:policy/DevAccess"
    }
  ]
}

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.