clear-lambda-storage-1.0.1
توضیحات
Clear Lambda code storage
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | clear-lambda-storage-1.0.1 |
| نام | clear-lambda-storage |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/epsagon/clear-lambda-storage |
| آدرس اینترنتی | https://pypi.org/project/clear-lambda-storage/ |
| مجوز | - |
Clear Lambda code storage
===========================
Motivation
-----------
AWS limits the total code storage for Lambda functions to `75GB <https://docs.aws.amazon.com/lambda/latest/dg/limits.html#limits-list>`_.
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
-----
.. code-block:: bash
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:
.. code-block:: bash
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 <https://serverless.com>`_ usage
----------------------------------------------------------
.. code-block:: bash
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:
.. code-block:: yaml
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
نیازمندی
| مقدار | نام |
|---|---|
| - | boto3 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3 | Python |
نحوه نصب
نصب پکیج whl clear-lambda-storage-1.0.1:
pip install clear-lambda-storage-1.0.1.whl
نصب پکیج tar.gz clear-lambda-storage-1.0.1:
pip install clear-lambda-storage-1.0.1.tar.gz