无服务器嵌套堆栈 - 发生错误:LogStack

时间:2017-12-07 04:47:46

标签: amazon-web-services amazon-cloudformation serverless

我使用无服务器将我的应用程序(NodeJS)部署到AWS。直到昨天我总共有55个端点和4 Lambda函数它工作正常。现在我有64个端点&我得到的5个lambda函数错误

**The Cloud Formation template is invalid: Template format error: Number of resources, 232, is greater than maximum allowed, 200**

所以我尝试了无服务器嵌套堆栈插件,现在我得到了以下错误

**An error occurred: APIStack - Template format error: Number of resources, 221, is greater than maximum allowed, 200**

**An error occurred: LogStack - Embedded stack arn:aws:cloudformation:eu-central-1:943203963451:stack/premierxnew-dev-LogStack-1GT5J43EL92T9/de4913a0-db05-11e7-909b-50a68ae71462 was not successfully c
reated: The following resource(s) failed to create: [AppOtherLogGroup, AppFaqLogGroup, AppUserLogGroup, AppOrderLogGroup, AppEventLogGroup]. .**

请告诉我如何解决此问题。

1 个答案:

答案 0 :(得分:0)

您已达到CloudFormation模板的硬限制。该文档说您应该在多个嵌套堆栈之间拆分资源以解决此限制。我假设您使用serverless deploy命令,正如文档所述:

  

" [...]将serverless.yml中的所有语法翻译为单个 AWS   CloudFormation模板"。

但是有希望,实际上GitHub在这个问题上存在问题:https://github.com/serverless/serverless/issues/2995

线程中的用户建议使用此插件:https://github.com/dougmoscrop/serverless-plugin-split-stacks

  

此插件的目标是将一些资源拆分为嵌套   堆栈以解决200 CloudFormation资源限制。

希望它有所帮助。