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

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

1 Antwort
0

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

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