Cloudformation 模板的“CAPABILITY\_IAM”错误

0

【以下的问题经过翻译处理】 我在部署Cloudformation模板时,我遇到了关于能力请求的如下异常: [CAPABILITY_IAM]。

我经过研究发现,当在模板中使用IAM资源时,我们必须明确告诉AWS我们清楚模板中的IAM资源。我已经这样做了。下面是我的命令:

$ ./update.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM

$ ./update.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM

$ ./create.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND

尝试了所有3个命令,但仍然显示以下错误:

An error occurred (InsufficientCapabilitiesException) when calling the UpdateStack operation: Requires capabilities : [CAPABILITY_IAM]

这是当时运行的代码:

这是我为S3创建的角色

IamS3Role: Type: AWS::IAM::Role Properties: ManagedPolicyArns: - "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess" AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Principal: Service: - ec2.amazonaws.com Action: - 'sts:AssumeRole' Path: /

实例附加的Profile文件

ProfileWithRolesForApp: Type: AWS::IAM::InstanceProfile Properties: Path: "/" Roles: - !Ref IamS3Role

请告诉我错在哪里。非常感谢。

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

【以下的回答经过翻译处理】 我的update.sh脚本出错了,现在已经解决。

profile picture
专家
已回答 5 个月前

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

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

回答问题的准则