# Deploy resources(files) rather than functions

**URL:** <https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [May 8, 2017, 1:21pm UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827 "2017-05-08T13:21:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tech-Me](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tech-me/32/3262_2.png) [@Tech-Me](https://forum.serverless.com/u/Tech-Me)\
**Post date:** [May 8, 2017, 1:21pm UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827/1 "2017-05-08T13:21:51Z")

</div>

I have read [Writing Testable AWS Lambda Functions](https://serverless.com/framework/docs/providers/aws/guide/testing#writing-testable-aws-lambda-functions).

So, if I changed logic in class **User** (users.js), how could I deploy it instead of re-deploy the whole service?

I know I can re-deploy individual function by using `sls deploy function -f <function name>`,  
then, how could I overwrite the same **users.js** in the latest deployment, as well as the **serverless.yml** file if made some changes.

Thank you.

---

<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:** [May 12, 2017, 10:11pm UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827/2 "2017-05-12T22:11:17Z")

</div>

Like you mention `sls deploy function -f <function name>` will update your function code without re-deploying the entire stack.

When a change is made to `serverless.yml` you will need to run a `sls deploy` (aka full deploy) to have those new values in serverless.yml take effect

---

<div class="post-metadata">

**Author:** ![Tech-Me](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tech-me/32/3262_2.png) [@Tech-Me](https://forum.serverless.com/u/Tech-Me)\
**Post date:** [May 14, 2017, 5:47am UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827/3 "2017-05-14T05:47:53Z")

</div>

Hi, DavidWells,  
Thanks for you reply.

As your said, maybe there is no way to just update **serverless.yml** but have to deploy all.  
How about update other files individually, such as _uuid_.js, _moment.js_, \_users.j\_s and so on?  
Those files are changing time and time again, but my functions in **handler.js** may not change so frequently.

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [May 14, 2017, 10:11am UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827/4 "2017-05-14T10:11:04Z")

</div>

You can’t update a single file in an existing function because AWS doesn’t allow it. You need to deploy a new package with all of the files required by that function.

---

<div class="post-metadata">

**Author:** ![Tech-Me](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tech-me/32/3262_2.png) [@Tech-Me](https://forum.serverless.com/u/Tech-Me)\
**Post date:** [May 15, 2017, 1:41pm UTC](https://forum.serverless.com/t/deploy-resources-files-rather-than-functions/1827/5 "2017-05-15T13:41:44Z")

</div>

Hi, buggy

It’s so pity, but rule…  
I got it, thank you:)
