9

我正在使用 AWS CLI,并且AWS Configure 在我启动 EC2 实例时已经使用:

C:\>aws ec2 run-instances --dry-run --image-id ami-b5a7ea85 --count 1 --instance
-type t2.micro --key-name ec2_key --iam-instance-profile Arn=arn:aws:iam::132895
064974:instance-profile/ec2Admin

它给了我:

A client error (UnauthorizedOperation) occurred when calling the RunInstances op
eration: You are not authorized to perform this operation. Encoded authorization
 failure message: 4doSfAQy0gcqKr1O-raIb0C83C2kLWQY8hjZ4gVtwUz6xSAwOtD2wumVnpgsz5
4

1 回答 1

21

你知道这意味着什么吗?

--iam-instance-profile Arn=arn:aws:iam::132895064974:instance-profile/ec2Admin

如果您要启动具有 IAM 角色的 EC2 实例,则您需要具有 IAM 管理权限。在这里详细讨论

您还可以尝试解码错误消息并查看其内容:

aws sts decode-authorization-message --encoded-message 4doSfAQy0gcqKr1O-raIb0C83C2kLWQY8hjZ4gVtwUz6xSAwOtD2wumVnpgsz5
于 2014-12-03T08:39:31.443 回答