Reputation: 23266
I have attached the following policy with an IAM user that should allow the user to create a snapshot of the EC2 instance (EBS backed).
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1473146965806",
"Action": [
"ec2:CreateSnapshot"
],
"Effect": "Allow",
"Resource": "arn:aws:ec2:*:MY_ACCOUNT_ID:*/*"
}
]
}
But when the user tries to execute the command to create a snapshot, the following error occurs:
An error occurred (UnauthorizedOperation) when calling the CreateSnapshot
operation: You are not authorized to perform this operation.
What is incorrect in the policy?
Upvotes: 0
Views: 4396
Reputation: 121
CreateSnapshot doesn't support resource-level permissions, you can use a wildcard for the "Resource":"*":
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1473146965806", "Action": [ "ec2:CreateSnapshot" ], "Effect": "Allow", "Resource": "*" } ] }
Upvotes: 2