Creating serverless applications within a single cloudformation template
Hi,
We are looking to build multiple serverless applications that would implement different use cases. These applications require multiple functions and other additional aws resources.
However, adding functions and other resources supported by the CLI will result in individual templates for each resource. Moreover, these resources will be included at the top level of the root cloudformation template and will count towards the template resource limit.
This poses two problems:
- The resources are no longer logically grouped together and makes understanding how these applications work very difficult.
- Adding functions via the CLI will result in many additional resources being added to the root cloudformation template. This will quickly become a problem as the number of functions we require may well exceed the template limit.
How should we go about implementing these applications? Ideally, we want to be able to declare multiple resources in a single nested template (including multiple functions) and still have the amplify cli manage the deployment and code builds for the functions.
Is there a way of creating multiple functions in a single template? This template may also include other cloudformation resources.
Thanks a lot!
@Jkap7788
The CLI uses nested cloudformation stacks so that the nested stacks can share information between each other and are logically nested. If you could give more details about the first problem, that would be great
For the second problem, Cloudformation has a soft limit of 200 stacks. We have rarely seen a single app tied to one AWS account scale to more than 200 nested stacks or functions. If for any reason you exceed this limit in your scenario, you can request for a stack limit increase with AWS support.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.