# Serverless - Template error

**URL:** <https://forum.serverless.com/t/serverless-template-error/7351>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [February 12, 2019, 1:06pm UTC](https://forum.serverless.com/t/serverless-template-error/7351 "2019-02-12T13:06:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kedarnag13](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/kedarnag13/32/2856_2.png) [@Kedarnag13](https://forum.serverless.com/u/Kedarnag13)\
**Post date:** [February 12, 2019, 1:06pm UTC](https://forum.serverless.com/t/serverless-template-error/7351/1 "2019-02-12T13:06:43Z")

</div>

Hello Everyone,

I’m running into an issue, when deploying the code. The error is

> Template is invalid: Template format error: Number of resources, 205, is greater than maximum allowed, 200

I googled a lot and on this forum and understood the problem is with the way I have handled all the functions. I have specified all of them in one `serverless.yml`. I should be using `cross-stack reference` or `nested stack`. I have around 30+ functions defined. I was thinking of doing the `cross-stack` as the `nested` approach is not a suggested solution. What I have done so far is,

I have the following directory structure.

```
users
      index.js
      serverless.yml #here I have defined the handler definition

```

From my understanding, in the root directory of my application, I have an `serverless.yml` in which I should reference the `users/serverless.yml` by using `export` and `import`.

My question, is when I run the `sls deploy` from the root of my directory will it continue to behave the same way it used to? Also, is this the correct approach to follow, as the application I’m building would be growing in terms of API’s.

Appreciate the help.  
Thank you.
