Listing Inline Policies Embedded in a User or a Group

You can get a list of all the inline policies embedded in a specified user or group.

You can then get information about the permissions contained in each inline policy. For more information, see Getting Information About an Inline Policy.

Listing Inline Policies Embedded in a User or a Group Using OSC CLI

Listing Inline Policies Embedded in a User

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

Listing Inline Policies Embedded in a Group

The ReadUserGroupPolicies command lists the names of the inline policies embedded in a specific group.

Request sample
$ osc-cli api ReadUserGroupPolicies --profile "default" \
    --FirstItem 1 \
    --ResultsPerPage 30 \
    --UserGroupName "example-usergroup" \
    --UserGroupPath "/example/"

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • FirstItem: (optional) The item starting the list of policies requested.

  • ResultsPerPage: (optional) The maximum number of items that can be returned in a single response (by default, 100).

  • UserGroupName: The name of the group.

  • UserGroupPath: (optional) The path to the group. If not specified, it is set to a slash (/).

The ReadUserGroupPolicies command returns the following elements:

  • HasMoreItems: If true, there are more items to return using the FirstItem parameter in a new request.

  • MaxResultsLimit: Indicates maximum results defined for the operation.

  • MaxResultsTruncated: If true, indicates whether requested page size is more than allowed.

  • Policies: A list of policies.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "HasMoreItems": true,
  "MaxResultsLimit": 30,
  "MaxResultsTruncated": true,
  "Policies": [
    {
      "Body": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}",
      "Name": "example-policy"
    }
  ]
}

Listing Inline Policies Embedded in a User or a Group Using oapi-cli

Listing Inline Policies Embedded in a Group

The ReadUserGroupPolicies command lists the names of the inline policies embedded in a specific group.

Request sample
$ oapi-cli --profile "default" ReadUserGroupPolicies \
    --FirstItem 1 \
    --ResultsPerPage 30 \
    --UserGroupName "example-usergroup" \
    --UserGroupPath "/example/"

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • FirstItem: (optional) The item starting the list of policies requested.

  • ResultsPerPage: (optional) The maximum number of items that can be returned in a single response (by default, 100).

  • UserGroupName: The name of the group.

  • UserGroupPath: (optional) The path to the group. If not specified, it is set to a slash (/).

The ReadUserGroupPolicies command returns the following elements:

  • HasMoreItems: If true, there are more items to return using the FirstItem parameter in a new request.

  • MaxResultsLimit: Indicates maximum results defined for the operation.

  • MaxResultsTruncated: If true, indicates whether requested page size is more than allowed.

  • Policies: A list of policies.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "HasMoreItems": true,
  "MaxResultsLimit": 30,
  "MaxResultsTruncated": true,
  "Policies": [
    {
      "Body": "{\"Statement\": [ {\"Effect\": \"Allow\", \"Action\": [\"*\"], \"Resource\": [\"*\"]} ]}",
      "Name": "example-policy"
    }
  ]
}

Listing Inline Policies Embedded in a User or a Group Using AWS CLI

Listing Inline Policies Embedded in a User

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To list inline policies embedded in a user, use the list-user-policies command following this syntax:

Request sample
$ aws iam list-user-policies \
    --profile YOUR_PROFILE \
    --user-name Jane \
    --endpoint https://eim.eu-west-2.outscale.com

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

The list-user-policies command returns the following element:

  • PolicyNames: The name of one or more inline policies embedded in the specified user.

Result sample
{
    "PolicyNames": [
        "AdminAccess",
        "DevAccess"
    ]
}

Listing Inline Policies Embedded in a Group

To list inline policies embedded in a group, use the list-group-policies command following this syntax:

Request sample
$ aws iam list-group-policies \
    --profile YOUR_PROFILE \
    --group-name Admin \
    --endpoint https://eim.eu-west-2.outscale.com

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

The list-group-policies command returns the following element:

  • PolicyNames: The name of one or more inline policies embedded in the specified group.

Result sample
{
    "PolicyNames": [
        "AdminAccess"
    ]
}

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.