问题
I'm trying to allow one user to all actions on us-west-2, this is the policy I have.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["ec2:*"],
"Resource": "arn:aws:ec2:us-west-2:837625274593:*"
}
]
}
I got the account number from "OWNER" parameter on an instance, not sure if is it.
回答1:
{
"Statement": [
{
"Sid": "Stmt1375943389569",
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:Region": "us-west-2"
}
}
}
]
}
That should enable the user to have all access to ec2 in only the us-west-2 region
来源:https://stackoverflow.com/questions/18112784/iam-allowing-a-user-to-access-everything-for-ec2-on-a-region