我尝试通过 CloudFormation 创建 AWS Spot 队列,但收到此权限错误。我通过根帐户创建此堆栈,因此我没有看到通过 CloudFormation 出现 IAM 错误的可能原因。
我正在使用 root 帐户凭据从 CLI 创建此堆栈。
有人遇到过这种情况吗?
最佳答案
我会检查 Amazon EC2 Spot Fleet Role 的说明:
If you create a managed compute environment that uses Amazon EC2 Spot Fleet Instances, you must create a role that grants the Spot Fleet permission to bid on, launch, tag, and terminate instances on your behalf. Specify the role in your Spot Fleet request. You must also have the AWSServiceRoleForEC2Spot and AWSServiceRoleForEC2SpotFleet service-linked roles for Amazon EC2 Spot and Spot Fleet.
另外,引用 Spot Fleet Pre-requisites 上的文档:
If you use the Amazon EC2 console to create a Spot Fleet, it creates a role named
aws-ec2-spot-fleet-tagging-role
that grants the Spot Fleet permission to request, launch, terminate, and tag instances on your behalf. This role is selected when you create your Spot Fleet request.If you use the AWS CLI or an API instead, you must ensure that this role exists.
关于amazon-web-services - CloudFormation 失败,出现 ec2 :RequestSpotFleet IAM error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58168909/