Reputation: 47
Policy used :
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:*AccessKey*"
],
"Effect": "Allow",
"Resource": [
"arn:aws:iam::account#:user/user1"
]
}
]
}
What does the policy do : Allows user to change to manage his own access keys .
What have I tried till now
You need permissions You do not have the permission required to perform this operation. Ask your administrator to add permissions. Learn more
User: arn:aws:iam::account#:user/user1 is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::account#:user/
Upvotes: 2
Views: 10819
Reputation: 13648
You need to allow IAM iam:ListUsers
actions on the *
resource. The error message indicates missing permission for that action.
See: Allow a User to List the Account's Groups, Users, Policies, and More for Reporting Purposes
There it provides a sample policy to: "Allow Users to Manage Their Own Passwords, Access Keys, and SSH Keys".
The following policy allows users to perform these actions in the AWS Management Console:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:*LoginProfile",
"iam:*AccessKey*",
"iam:*SSHPublicKey*"
],
"Resource": "arn:aws:iam::account-id-without-hyphens:user/${aws:username}"
},
{
"Effect": "Allow",
"Action": [
"iam:ListAccount*",
"iam:GetAccountSummary",
"iam:GetAccountPasswordPolicy",
"iam:ListUsers"
],
"Resource": "*"
}
]
}
Upvotes: 5