Deploy error: number of resources greater than 200

I am working on my first serverless application. It works offline, but when I try to deploy it to AWS I the the following message

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

I suspect I am doing something fundamentally wrong, but do not know what. Suggestions?

What does your serverless.yml look like?

Sounds like it has ALOT of functions in it :see_no_evil:

You might need to split up the service into smaller pieces or use sub stacks

Thanks David! I have 32 functions in my serverless.yml I removed some which has brought down the number of resources. Is there a guideline on breaking up services? I am not familiar with sub stacks. Time to do more research!

Sub stacks are painful to use from what I hear

You are better off breaking up your large large service into microservices based on the domain they handle.

Like a user-service, billing-service, auth-service etc

Depends on your app on how you’d logically break in down into smaller pieces.

I recommend checking out pretty much all the microservice talks from https://www.youtube.com/user/GotoConferences

1 Like