Serverless SplitStacks Configuration - Cloudformation limit #13057
Replies: 1 comment
-
|
Categories is not an option that I'm aware of with serverless-split-stacks. You do need to destroy your stack and recreate it for the new splitting logic to be applied, so maybe that is why you're not seeing it split after your changes? When I initially started using the plugin I went with 10 nested stacks and let the plugin determine how they'd be split, but eventually I ran into the circular dependency issue between stacks. It's usually an issue with API gateway resources so the first solution was to move all those resources into the root stack, but an important caveat of the plugin is it won't move existing resources, and the root stack was already fairly big and so I ran into the limit again soon after. I ended up writing my own splitting logic, which let me group resources into their own stacks with as little interdependencies as possible so I wouldn't run into the circular dependency issue. I ended up doing 1 stack for IAM, 1 for step functions, 6 for lambas split by first letter, 6 api gateway with the same logic, and 6 for Logs also with the same logic, so 20 nested with 1 root. Any stateful resources like s3, dynamo, etc were moved to terraform incase the stack needed to be destroyed and recreated at some point. It's not pretty, but this is what my splitting logic ended up as: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am wondering if anyone can help me out. I have come across the 500 resource limit, and I am trying to use the serverless plugin split stacks to try and split my current stack into multiple stacks to try and get around this limit.
At current we have a single serverless.yaml file at root which points to all functions, as well as s3, sns topics etc.
I have a simple configuration of:
"
splitStacks:
perType: true
perGroupFunction: false
stackConcurrency: 10
resourceConcurrency: 20
nestedStackCount: 50
categories:
- AWS::ApiGateway::Method
- AWS::Lambda::Function
- AWS::S3::Bucket
"
I am not sure if I am using the plugin correctly. I have tried creating more categories, played around with setting perFunction to true, etc. When I run serverless package it might show various stacks being created per lambda, taking root resources down to 70 in one such configuration.
However, when I try to deploy the service again, it will revert to a cloudformation with 1-3 stacks, and 500 resources at root. I am wondering what may be the solution here, as it seems that whatever configuration I make it will return to 500 resources.
There are about 100 lambda endpoints, various sns topics, an s3 bucket, persmissions, etc. all in this main service. Is it feasible to use the split stacks plugin to create various separate stacks to share the resources amongst them.
If so, can anyone give me any pointers on how this would be achieved?
Much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions