【问题标题】:(InsufficientCapabilitiesException): Requires capabilities : [CAPABILITY_AUTO_EXPAND](InsufficientCapabilitiesException):需要能力:[CAPABILITY_AUTO_EXPAND]
【发布时间】:2020-09-28 01:49:39
【问题描述】:

基于本地 AWS Cloud Formation .yaml 文件。我正在运行以下命令

aws cloudformation create-stack --stack-name someTest --template-body file://template.yaml

抛出以下错误

An error occurred (InsufficientCapabilitiesException) when calling the CreateStack operation: Requires capabilities : [CAPABILITY_AUTO_EXPAND]

我读过here,这与模板包含macros 的事实有关。在这种情况下,在.yaml文件内部,它调用了AWS::Serverless::Function,即

Resources:
  ResourceName:
    Type: AWS::Serverless::Function 
    ...
    ...

在创建堆栈时解决此问题的选项有哪些?

【问题讨论】:

标签: amazon-web-services amazon-cloudformation


【解决方案1】:

解决方案:

只是追加

--capabilities CAPABILITY_AUTO_EXPAND

到命令

aws cloudformation create-stack --stack-name someTest --template-body file://template.yaml --capabilities CAPABILITY_AUTO_EXPAND

解释:

正如documentation 所述,宏对模板执行自定义处理,例如操作和转换。在此示例中,AWS::Serverless 转换“采用以 AWS 无服务器应用程序模型语法编写的模板,并将其转换并扩展为兼容的 AWS CloudFormation 模板”。

因此,当在包含宏的模板上调用create-stack 操作时,它应该指定能力 CAPABILITY_AUTO_EXPAND

【讨论】:

    猜你喜欢
    • 2019-06-30
    • 2019-07-04
    • 2015-02-16
    • 2017-08-23
    • 1970-01-01
    • 1970-01-01
    • 2019-07-11
    • 1970-01-01
    • 2015-05-10
    相关资源
    最近更新 更多