• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Removes old versions of Lambda functions

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:

python clear_lambda_storage.py --profile <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

More Repositories

1

list-lambdas

Enumerate Lambda functions across all regions with useful metadata 💡💵⚙
Python
187
star
2

lambda-cost-calculator

Forecast Lambda functions costs 💰
Python
105
star
3

lambda-memory-performance-benchmark

Performance and cost benchmark tool for AWS Lambda on memory sizes 📈⏱
Python
63
star
4

epsagon-node

Automated tracing library for Node.js 8.x, 10.x, 12.x, and 14.x ⚡️
JavaScript
57
star
5

serverless-plugin-epsagon

Epsagon's plugin for Serverless Framework ⚡️
JavaScript
55
star
6

lambda-internals

Useful utilities for Lambda environment explorations
Python
55
star
7

epsagon-python

Automated tracing library for Python 2.7, 3.6, 3.7 and 3.8 ⚡️
Python
55
star
8

serverless-package-external

Add external folders to the deploy package 📦
JavaScript
55
star
9

retail-store-workshop

Example retail store application for workshops based on AWS and serverless
JavaScript
34
star
10

epsagon-go

Automated tracing library for Go 1.x ⚡️
Go
28
star
11

reddit-slackbot

Serverless Slack bot for tracking Reddit submissions
Python
20
star
12

epsagon-browser

JavaScript
14
star
13

epsagon-kubernetes

Python
11
star
14

state-machine-invoker

A template AWS Lambda handler for invoking Step Functions correctly and easily
Python
10
star
15

sqs-lambda-tutorial

Simple example for Lambda->SQS->Lambda ⚡️
Python
9
star
16

epsagon-k8s-external-exporters

Shell
9
star
17

express-lambda-boilerplate

Simple express API powered by AWS Lambda and Serverless CLI
JavaScript
6
star
18

monitoring-workshop

Monitoring Workshop - Teaches serverless monitoring and debugging fundamentals
4
star
19

kinesis-autoscaler

Autoscaling solution for Kinesis data streams
Python
4
star
20

epsagon-ruby

Automated tracing library for Ruby 2.x ⚡️
Ruby
3
star
21

epsagon-dotnet

Automated tracing library for .NET core 2.x and 3.x ⚡️
C#
3
star
22

jobs

Open positions @ Epsagon
3
star
23

express-monitoring-workshop

Build and observe a Serverless express application
JavaScript
2
star
24

epsagon-node-runtime

Custom node runtime for AWS Lambda
Shell
2
star
25

helm-charts

Smarty
2
star
26

epsagon-node-frameworks

Automated tracing library for Node.js frameworks ⚡️
JavaScript
2
star
27

epsagon-operator

Epsagon Kubernetes Operator
Go
1
star
28

mergify-tests

1
star
29

epsagon-logs-sender

Epsagon Logs Sender
Python
1
star
30

epsagon-k8s-role

Epsagon Role for k8s clusters
Shell
1
star
31

epsagon-node-openwhisk

Tracing library for OpenWhisk ⚡️
JavaScript
1
star
32

lambda-auth0-example

Example of AWS Lambda with Auth0 in Python ⚡🐍
Python
1
star
33

epsagon-cdk

Epsagon integration for CDK's
TypeScript
1
star
34

opentelemetry-workshop

HTML
1
star