GithubHelp home page GithubHelp logo

isabella232 / clear-lambda-storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epsagon/clear-lambda-storage

0.0 0.0 0.0 44 KB

Removes old versions of Lambda functions

Home Page: https://epsagon.com/blog/how-to-free-aws-lambda-code-storage-codestorageexceeded/

License: MIT License

Python 100.00%

clear-lambda-storage's Introduction

Clear Lambda code 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

Install via pip

pip install clear-lambda-storage
clear_lambda_storage

Install via source

git clone https://github.com/epsagon/clear-lambda-storage
cd clear-lambda-storage/
pip install -r requirements.txt
python clear_lambda_storage.py

Advanced usage

Provide credentials:

python clear_lambda_storage.py --token-key-id <access_key_id> --token-secret <secret_access_key>

Alternate usage: .. code-block:: bash

python clear_lambda_storage.py --profile-id <profile_id> --num-to-keep 2

⚡️ Serverless Framework usage

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

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

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

clear-lambda-storage's People

Contributors

alex4108 avatar drodger avatar gihandesilva avatar huynguyenh avatar lucasbastianik avatar macunha1 avatar pziemkowski avatar ranrib avatar sanketjpatel avatar scoppio avatar siutsin avatar victormesas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.