serverless-next.js: Number or resources > 200
Finally deploying my project en AWS, I’ve got this :
The CloudFormation template is invalid: Template format error: Number of resources, 226, is greater than maximum allowed, 200
I dont know this error. FWI, I’ve got 37 pages.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 19 (4 by maintainers)
We disagree on all of that except the documentation update 😃 But regardless, my take is that this plugin is useful, but is flawed in that hitting the CloudFormation limit is a major showstopper. Before I was going to use this plugin, I purposefully looked for this exact issue since I’m very familiar with AWS and knew of the hard limit. Other developers using this plugin will find out the hard way.
If the identity and usefulness of this plugin are based around splitting up the functions, then by all means. I would still update the docs. to make devs. aware of this limit at least.
I will document the CF limitation. Also, I’m currently looking into how the plugin could be ported to a serverless-component, which for the most part uses plain API calls rather than CF.
I’m currently trying to get v2.0 released first, but for that I need to finish CloudFront support (https://github.com/danielcondemarin/serverless-nextjs-plugin/pull/95)
After that’s sorted will look in more detail how to port to a serverless-component.
@Vadorequest I dont think this plugin should go on this “one route to handle them all” because you can do that pretty easily by yourself with a single lambda with next build. Imo, there is no added value to this plugin for that.
(https://github.com/romainquellec/boilerplate/tree/e72c9a162507519fe8667b8c7d6b3c7b11e59ab5)
@romainquellec It’s definitely on my radar. Seems like it might be addressed in the serverless framework itself: https://github.com/serverless/serverless/issues/3411
If you don’t need function versioning you can switch it off:
That’s 37 less resources.
Also, I will look into why
serverless-plugin-split-stacksor nested-stacks doesn’t work with the plugin.