aws iam list-attached-user-policies

From wikieduonline
Jump to navigation Jump to search

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/list-attached-user-policies.html

aws iam list-attached-user-policies --user-name YOUR_USERNAME

To obtain username:

Official AWS example output[edit]

{
  "AttachedPolicies": [
    {
      "PolicyName": "AdministratorAccess",
      "PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess"
    },
    {
      "PolicyName": "SecurityAudit",
      "PolicyArn": "arn:aws:iam::aws:policy/SecurityAudit"
    }
  ],
  "IsTruncated": false
}

Errors[edit]

An error occurred (AccessDenied) when calling the ListAttachedUserPolicies operation: User: arn:aws:sts::0987654321:assumed-role/YYYY/XXXXX is not authorized to perform: iam:ListAttachedUserPolicies on resource: user YOUR_USERNAME because no identity-based policy allows the iam:ListAttachedUserPolicies action

Related[edit]

See also[edit]

Advertising: