https://github.com/rewindio/lambda-version-cleaner
Scheduled Lambda function packaged with SAM which removes old Lambda versions
https://github.com/rewindio/lambda-version-cleaner
Last synced: over 1 year ago
JSON representation
Scheduled Lambda function packaged with SAM which removes old Lambda versions
- Host: GitHub
- URL: https://github.com/rewindio/lambda-version-cleaner
- Owner: rewindio
- Created: 2023-09-14T14:09:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T19:20:45.000Z (over 2 years ago)
- Last Synced: 2025-01-31T07:45:44.620Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Lambda Version Cleaner
- [Purpose](#purpose)
- [Installing](#installing)
## Purpose
This SAM template deploys a Lambda function that deletes old Lambda versions in the account deployed in.
## Installing
There are deployment workflows that handle deployment on PR merge. If you want to install manually, everything is packaged with [AWS SAM](https://aws.amazon.com/serverless/sam/). Note that the `AlarmsSNSTopic` parameter is optional and if provided, will also deploy a CloudWatch alarm on invocation errors which pushes alarm events to the specified `AlarmsSNSTopic`. Clone this repo and run the following commands:
```sh
sam build --use-container
sam deploy --debug \
--stack-name lambda-version-cleaner \
--s3-bucket \
--region \
--profile \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
"NumberOfVersionsToKeep= \
AWSRegions= \
AlarmsSNSTopic=" \
--no-fail-on-empty-changeset
e.g.
sam deploy --debug \
--stack-name lambda-version-cleaner \
--s3-bucket some-s3-bucket \
--region us-east-1 \
--profile staging \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
"NumberOfVersionsToKeep=10 \
AWSRegions=us-east-1,us-east-2" \
--no-fail-on-empty-changeset
```