epsagon / clear-lambda-storage

Removes old versions of Lambda functions
https://epsagon.com/blog/how-to-free-aws-lambda-code-storage-codestorageexceeded/
MIT License
165 stars 44 forks source link

Missing "--function-names" argument on cli #33

Open GaahNoel opened 3 months ago

GaahNoel commented 3 months ago

Description

Hello! 😄

I'm trying to run the cli command clear_lambda_storage with the argument --function-name and the cli cannot handle it. Clonning the repository and running locally, the code accepts this argument.

It's possible to add the support for this argument to the cli? I'm trying to use this function on my github actions pipeline and will be much more easy using direclty the cli instead of pushing the code on so many repositories that i need. 😅

Examples

Command that i'm trying to use: clear_lambda_storage --num-to-keep 3 --function-names=function-name --regions=us-east-1

Command that i successfully used running the code locally: python clear_lambda_storage.py --num-to-keep 3 --function-names=function-name --regions=us-east-1

Current supported arguments on cli:

options:
  -h, --help            show this help message and exit
  --token-key-id token-key-id
                        AWS access key id. Must provide AWS secret access key as well (default: from local configuration).
  --token-secret token-secret
                        AWS secret access key. Must provide AWS access key id as well (default: from local configuration.
  --profile profile     AWS profile. Optional (default: "default" from local configuration).
  --regions regions [regions ...]
                        AWS region to look for old Lambda versions
  --num-to-keep num-to-keep
                        Number of latest versions to keep. Older versions will be deleted. Optional (default: 2).
ranrib commented 3 months ago

Hi @GaahNoel you are welcome to contribute this feature in a PR and I’ll approve that. Thanks