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请求的情况下失败。

1 Antwort
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
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen