AnalogJ / thesparktree-blog

github pages.
https://blog.thesparktree.com
0 stars 1 forks source link

Serverless Framework - Tips & Tricks #100

Open AnalogJ opened 4 years ago

AnalogJ commented 4 years ago

10 Things you need to know about Serverless

Lambda and event-based dsf

Here are the things you need to know when using the Serverless framework:

Cleanup

By default, Serverless won't cleanup after you. If you have a Continuous Deployment setup, you'll hit the 75gb Lambda storage limit suprisingly quickly.

The fix is pretty simple, just install the purge-plugin

npm install --save-dev serverless-prune-plugin

Add the plugin to your serverless.yml file:

plugins:
  - serverless-prune-plugin

And then prune old versions during your deployments

sls prune -n <number of version to keep>    

Serverless outputs as env variables:

https://github.com/serverless/serverless/issues/2240