Skip to content

Lambda function which sets the retention period on cloudwatch log groups

License

Notifications You must be signed in to change notification settings

previewme/cloudwatch-log-retention

Repository files navigation

cloudwatch-log-retention

CI Workflow Coverage Vulnerabilities Quality Gate Status

Lambda function which automatically sets the retention period for all newly created Cloudwatch Log groups. When the retention period is modified or deleted, the function will reinstate the correct retention period.

Configuration

Environment variables

Environment Variable Description Required Default
RETENTION_PERIOD_IN_DAYS The retention period to set on Cloudwatch Log groups in days No 90

Build

To build the lambda function run the following.

npm install
npm run build

Test

To run the tests.

npm test

Package

The following will package the lambda function into a zip bundle to allow manual deployment.

zip -q -r dist/lambda.zip node_modules dist

About

Lambda function which sets the retention period on cloudwatch log groups

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published