{"repo":"lumigo-io/SAR-Lambda-Janitor","free":true,"listed":false,"github":"https://github.com/lumigo-io/SAR-Lambda-Janitor","clone":"git clone https://github.com/lumigo-io/SAR-Lambda-Janitor.git","description":"Cron job for deleting old, unused versions of your Function","language":"JavaScript","stars":142,"topics":["serverless","lambda","aws"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"SAR-Lambda-Janitor Cron job for deleting old, unused versions of your Function. This post explains the problem and why we created this app. Safeguards To guard against deleting live versions, some safeguards are in place: Never delete the $LATEST version . This is the default version that will be used when you invoke a function. Never delete versions that are referenced by an alias . If you use aliases to manage different stages - dev, staging, etc. then the latest version referenced by your aliases will not be deleted. Keeping the most recent N versions . Even if you don't use aliases at all, we will always keep the most recent N versions, where N can be configured with the VersionsToKeep parameter when you install the app. Defaults to 3 . Deploying to your account (via the console) Go to this page and click the Deploy button. This app would deploy the following resources to your region: a Lambda function that scans the functions in your region and deletes unused versions a CloudWatch event schedule that triggers the Lambda function every hour Deploying via SAM/Serverless framework/CloudFormation To deploy this app via SAM, you need something like this in the CloudFormation template: To do the same via CloudFormation or the Serverless framework, you need to first add the following Transform : For more details, read this post.","default_branch":null,"files":null,"tree":[],"storefront":"/r/lumigo-io","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lumigo-io/SAR-Lambda-Janitor/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}