An open API service indexing awesome lists of open source software.

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

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
```