如何生成创build快照的IAM策略?

我已经在要创build快照的EC2实例上安装了卷。

我使用以下策略创build了一个新的IAM用户:

{ "Statement": [ { "Sid": "...", "Effect": "Allow", "Action": [ "ec2:CreateSnapshot", "ec2:CreateTags", "ec2:DeleteSnapshot", "ec2:DescribeAvailabilityZones", "ec2:DescribeSnapshots", "ec2:DescribeTags", "ec2:DescribeVolumeAttribute", "ec2:DescribeVolumeStatus", "ec2:DescribeVolumes" ], "Resource": [ "arn:aws:ec2:eu-west-1:MY_USER_ID" ] } ] } 

我已经将访问密钥和秘密添加到了我的~/.bashrc并提供了它。 当我运行ec2-describe-snapshots我得到这个响应: Client.UnauthorizedOperation: You are not authorized to perform this operation.

当我的"Resource"只是"*"我能够列出所有types的亚马逊的快照。 我正在寻找在eu-west-1地区创build/可见的快照。

明智地张贴在如何限制EC2描述图像的权限 ,资源级别的权限根本没有实现ec2:Describe*操作。

在现实中,你需要限制基于其他东西的访问,而不是资源ARN。