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.
$ 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 theFirstItem
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.-
Body
: The policy document, corresponding to a JSON string that contains the policy. For more information, see EIM Reference Information and EIM Policy Generator. -
Name
: The name of the policy.
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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.
$ 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 theFirstItem
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.-
Body
: The policy document, corresponding to a JSON string that contains the policy. For more information, see EIM Reference Information and EIM Policy Generator. -
Name
: The name of the policy.
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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:
$ 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:
-
(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. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The list-user-policies command returns the following element:
-
PolicyNames
: The name of one or more inline policies embedded in the specified user.
{
"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:
$ 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:
-
(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. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The list-group-policies command returns the following element:
-
PolicyNames
: The name of one or more inline policies embedded in the specified group.
{
"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.