基于本地AWS Cloud file .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
...
...在创建堆栈时,有哪些解决此问题的选项?
发布于 2020-06-09 08:34:55
解决方案:
只需追加即可
--capabilities CAPABILITY_AUTO_EXPAND添加到命令
aws cloudformation create-stack --stack-name someTest --template-body file://template.yaml --capabilities CAPABILITY_AUTO_EXPAND解释:
正如documentation声明的那样,宏对模板执行自定义处理,如操作和转换。在本例中,AWS::Serverless转换“采用AWS Serverless Application Model语法编写的模板,并将其转换和扩展为符合AWS CloudFormation的模板”。
因此,当在包含宏的模板上调用create-stack操作时,它应该指定capability CAPABILITY_AUTO_EXPAND。
https://stackoverflow.com/questions/62273210
复制相似问题