# Deploy error: number of resources greater than 200

**URL:** <https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422>\
**Category:** Serverless Framework\
**Created:** [January 2, 2018, 6:52pm UTC](https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422 "2018-01-02T18:52:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gap](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gap](https://forum.serverless.com/u/gap)\
**Post date:** [January 2, 2018, 6:52pm UTC](https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422/1 "2018-01-02T18:52:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DavidWells](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/davidwells/32/201_2.png) [@DavidWells](https://forum.serverless.com/u/DavidWells)\
**Post date:** [January 2, 2018, 7:11pm UTC](https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422/2 "2018-01-02T19:11:48Z")

</div>

What does your serverless.yml look like?

Sounds like it has ALOT of functions in it 🙈

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

---

<div class="post-metadata">

**Author:** ![gap](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gap](https://forum.serverless.com/u/gap)\
**Post date:** [January 2, 2018, 9:11pm UTC](https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422/3 "2018-01-02T21:11:56Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![DavidWells](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/davidwells/32/201_2.png) [@DavidWells](https://forum.serverless.com/u/DavidWells)\
**Post date:** [January 3, 2018, 12:13am UTC](https://forum.serverless.com/t/deploy-error-number-of-resources-greater-than-200/3422/4 "2018-01-03T00:13:44Z")

</div>

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](https://www.youtube.com/user/GotoConferences)
