Amazon web services 亚马逊对特定图像发布的权限有限
我创建了一个用户,并为他提供了以下权限。我希望该用户只能使用特定的标记键/值(“打开”)启动AMI。但用户在从映像启动实例期间获得“初始化失败”Amazon web services 亚马逊对特定图像发布的权限有限,amazon-web-services,amazon-ec2,Amazon Web Services,Amazon Ec2,我创建了一个用户,并为他提供了以下权限。我希望该用户只能使用特定的标记键/值(“打开”)启动AMI。但用户在从映像启动实例期间获得“初始化失败” { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1434563026000", "Effect": "Allow", "Action": "ec2:RunInstances",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1434563026000",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/ImgEnv": "Open"
}
},
"Resource": [
"arn:aws:ec2:*"
]
},
{
"Effect": "Allow",
"Action": ["ec2:Describe*",
"ec2:*Vpc*",
"ec2:*Subnet*",
"ec2:*Gateway*",
"ec2:*Vpn*",
"ec2:*Route*",
"ec2:*Address*",
"ec2:*SecurityGroup*",
"ec2:*NetworkAcl*",
"ec2:*DhcpOptions*" ],
"Resource": "*"
}
]
}
这里有一个适用于您的策略(如果您不使用us-east-1,请确保用您的帐户ID替换“帐户”,并更改区域): } 我认为这样构造策略是必要的,因为并非RunInstances上下文中的所有资源都需要(或被)标记。只是图像而已 我发现在检查和测试这个答案时很有用 另外,我关注的是你的许可。您仍然应该添加更多策略,以允许使用您想要的描述/其他API,例如
{
"Effect": "Allow",
"Action": ["ec2:Describe*",
"ec2:*Vpc*",
"ec2:*Subnet*",
"ec2:*Gateway*",
"ec2:*Vpn*",
"ec2:*Route*",
"ec2:*Address*",
"ec2:*SecurityGroup*",
"ec2:*NetworkAcl*",
"ec2:*DhcpOptions*" ],
"Resource": "*"
}
你需要给我更多的细节。与调试模式下的RunInstances命令的输出类似。请给我一份你用过的保险单。这应该行得通。我没有使用cli,我使用的是界面,我想创建一个像User1这样的用户。我想从我的AMI向他提供唯一的实例启动权限,即key-Value-production=open。我使用您的解决方案,但其显示初始化失败。我在另一篇文章中提供了我的所有详细信息,请查看。
{
"Effect": "Allow",
"Action": ["ec2:Describe*",
"ec2:*Vpc*",
"ec2:*Subnet*",
"ec2:*Gateway*",
"ec2:*Vpn*",
"ec2:*Route*",
"ec2:*Address*",
"ec2:*SecurityGroup*",
"ec2:*NetworkAcl*",
"ec2:*DhcpOptions*" ],
"Resource": "*"
}