我可以在管理控制台中使用iam-role启动ec2-instance.但我不知道如何从aws-ruby-sdk启动带有iam-role的ec2-instance
iam-role " test"'s Policy is here
"Effect": "Allow",
"Action": "*",
"Resource": "*"
Run Code Online (Sandbox Code Playgroud)
结果如下:
/var/lib/gems/1.8/gems/aws-sdk-1.7.1/lib/aws/core/client.rb:318:in `return_or_raise':
You are not authorized to perform iam:PassRole with arn:aws:iam::xxxxxxxxxxx:role/test
(AWS::EC2::Errors::UnauthorizedOperation)
Run Code Online (Sandbox Code Playgroud)