1

I am using Serverless(https://github.com/serverless/serverless) to deploy my functions to AWS Lambda. However, Now I started getting the error:

Template format error: Number of resources, 217, is greater than maximum allowed, 200

After some research I found out that this limit is the limit from AWS CloudFormation, soI was wondering how I can deploy my application to Lambda via Serverless.

Any help would be appriciated.

Thanks!

  • By having 200 or fewer resources in your functions? – Mark Henderson May 16 '17 at 12:51
  • If it were only functions, it would be easier, however each lambda endpoint in serverless always requires atleast 4 resources. – Ayush Gupta May 16 '17 at 12:57
  • The framework creator's answer is here: serverless.com/blog/… – dhill May 14 '18 at 10:46
4

The 200 number is a hard limit. You will not be able to deploy this application, as is, through serverless.

However, if you're willing to break things up, you can get around it. CloudFormation has that 200-resource limit for a reason, and straight up CloudFormation users have been wrestling with it for a while. There are three ways we have been handling this:

  1. Reduce the number of resources you're using (not always possible).
  2. Use nested templates, where a parent template invokes other templates.
  3. Break up your template into more than one template running in parallel.

The 'serverless' framework likely doesn't have a native way to split things up, so you will have to do some work. Probably by splitting your template into two different templates, as I doubt it will do nested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.