CmdID

CmdID / aws / aws iam

aws iam get-user-policy

Retrieves the specified inline policy document that is embedded in the specified IAM user. AWS CLI reference

1 example 2 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To list policy details for an IAM user

The following get-user-policy example lists the details of the specified policy that is attached to the IAM user named Bob.

aws iam get-user-policy --user-name Bob --policy-name ExamplePolicyIdentify
--user-nameThe name of the user who the policy is associated with.
--policy-nameThe name of the policy document to get.
Its output
{
    "UserName": "Bob",
    "PolicyName": "ExamplePolicy",
    "PolicyDocument": {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Action": "*",
                "Resource": "*",
                "Effect": "Allow"
            }
        ]
    }
}

To get a list of policies for an IAM user, use the list-user-policies command.

For more information, see Policies and permissions in IAM in the AWS IAM User Guide.

Options

2 in the AWS CLI reference
--policy-nameThe name of the policy document to get.
--user-nameThe name of the user who the policy is associated with.