Skip to content

lucasbastianik/clear-lambda-storage-serverless

Repository files navigation

Travis License: MIT

⚡ Serverless Clear Lambda code storage

Serverless function that clear Lambda code storage. This project is based on epsagon/clear-lambda-storage.

Motivation

AWS limits the total code storage for Lambda functions to 75GB.

The main reason of reaching such size is because for every deployment of existing function, AWS stores the previous version ("qualifier").

Usually, when you reach that point, you want to remove old version. This tool will help you to!

Setup

npm i -g serverless
git clone https://github.com/lucasbastianik/clear-lambda-storage-serverless
cd clear-lambda-storage-serverless/
serverless deploy

Cron

You can schedule this Lambda code storage clean to run every period you want like code above:

functions:
  clear_lambda_storage:
    handler: handler.clear_lambda_storage
    memorySize: 128
    timeout: 120
    events:
      - schedule: cron(0 12 ? * SUN *) # Run every sunday at 12:00pm UTC

About

🗑 Clear Lambda storage code using Serverless Framework ⚡️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages