Cloudformation root stack resources are not split properly with serverless-plugin-split-stacks

1.8k views Asked by At

We use serverless-plugin-split-stacks to break resources into nested stacks and have set it up in serverless.yml as follows.

custom:
  splitStacks:
    perFunction: false
    perType: true
    perGroupFunction: false
  webpack:
    webpackConfig: ./webpack.config.js
    includeModules: true

Everything was going well until we were greeted with the following error

Error: The CloudFormation template is invalid: Template format error: Number of resources, 206, is > greater than maximum allowed, 200

When this error happens, the condition of the nested stacks is as follows.

Serverless: [serverless-plugin-split-stacks]:    Resources per stack:
Serverless: [serverless-plugin-split-stacks]:    - (root): 206
Serverless: [serverless-plugin-split-stacks]:    - APINestedStack: 55
Serverless: [serverless-plugin-split-stacks]:    - PermissionsNestedStack: 49

My problem is that even though we have set up split-stacks properly, why doesn't it split the resources in the root stack into new stacks?

If there's anything I have missed here, please educate me on this. Thanks for all helpful suggestions.

1

There are 1 answers

2
Vanderson Andrade On

This npm package serverless-plugin-split-stacks not working. This package has been Deprecated - FAILED - BUG For more information: https://www.npmjs.com/package/serverless-plugin-split-stacks

To resolve your problem (Serverless Workarounds for CloudFormation's 200 Resource Limit) read some tips: https://www.serverless.com/blog/serverless-workaround-cloudformation-200-resource-limit