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

**URL:** <https://forum.serverless.com/t/template-format-error-number-of-resources-202-is-greater-than-maximum-allowed-200/463>\
**Category:** Serverless Framework\
**Created:** [October 5, 2016, 10:31pm UTC](https://forum.serverless.com/t/template-format-error-number-of-resources-202-is-greater-than-maximum-allowed-200/463 "2016-10-05T22:31:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cloud](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Cloud](https://forum.serverless.com/u/Cloud)\
**Post date:** [October 5, 2016, 10:31pm UTC](https://forum.serverless.com/t/template-format-error-number-of-resources-202-is-greater-than-maximum-allowed-200/463/1 "2016-10-05T22:31:43Z")

</div>

Hi,

I recently got the above error message when doing an sls deploy. I’m guessing this is because I have a single Service Service with a lot of endpoints underneath it. To give you an example of the size my serverless.ymal is around 1000 lines of config. It defines many many endpoints for many lambdas which each include / exclude individual files. I created a single service because I have some code (Data Access Layer + Logic) that is shared between many lambdas.

My API is currently tiny compare to what the full production API will be. I guess I have to split it up in to several Serverless Services and upload each service. My question is, is there a way to share a lib between multiple services? or am I going to have to create a build script around this common library that gets deployed to each service (pretty much like npm install)?

Thanks,

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [October 5, 2016, 10:42pm UTC](https://forum.serverless.com/t/template-format-error-number-of-resources-202-is-greater-than-maximum-allowed-200/463/2 "2016-10-05T22:42:36Z")

</div>

Yes, if you’re after code sharing they you should use whatever module/package management tool your language (e.g. `npm` for node, etc), and just treat your separate Serverless servers as stand-alone applications (aka. microservices). This will ensure you can lock your code to specific versions, which will make upgrading shared functionality _much_ easier in the future (trust me on this one).

If you need to share AWS resources (e.g. ARNs, etc) then you want [the new cross-stack references](https://aws.amazon.com/blogs/aws/aws-cloudformation-update-yaml-cross-stack-references-simplified-substitution/). Each of your services will be their own CFN stack, and you can define your own outputs, and refer to them from other services.
