我正在使用AWS CLI并已使用AWS Configure
配置它
当我使用:
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
答案 0 :(得分:15)
你知道这意味着什么吗?
--iam-instance-profile Arn=arn:aws:iam::132895064974:instance-profile/ec2Admin
如果要启动具有IAM角色的EC2实例,则需要具有IAM管理权限。详细讨论了here
您还可以尝试解码错误消息并查看其内容:
aws sts decode-authorization-message --encoded-message 4doSfAQy0gcqKr1O-raIb0C83C2kLWQY8hjZ4gVtwUz6xSAwOtD2wumVnpgsz5