CloudFormation脚本失败,并出现以下错误信息:SpotFleetRequestConfigData/LaunchSpecifications/0/IamInstanceProfile:expected type:JSONObject,found:String

0

【以下的问题经过翻译处理】 我正在尝试通过clouldformation yaml启动一个spot fleet请求。在此过程中,我收到错误信息“#/SpotFleetRequestConfigData/LaunchSpecifications/0/IamInstanceProfile: expected type: JSONObject,found: String”。

由于某些原因,我无法将角色传递给正在创建的spot实例。在没有这个特定行的情况下,脚本可以正常运行。失败的行是LaunchSpecifications中的第一行。我尝试了使用原始JSON,但是仍然出现相同的错误。如何解决这个问题?是否有一种方法检查是否存在权限问题? 另外,这个配置对于启动普通的ec2实例没有问题。仅在SpotFleet请求的情况下失败。

profile picture
专家
已提问 5 个月前24 查看次数
1 回答
0

【以下的回答经过翻译处理】 可以按照如下方式修改:

修改前

LaunchSpecifications:
    - IamInstanceProfile: arn:aws:iam::773057xxxxxx:instance-profile/EC2_Role_R53

修改后

LaunchSpecifications:
    - IamInstanceProfile: 
         Arn: arn:aws:iam::773057xxxxxx:instance-profile/EC2_Role_R53

请查看以下文档! https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-iaminstanceprofilespecification.html

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则