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.
Environment Variable | Description | Required | Default |
---|---|---|---|
RETENTION_PERIOD_IN_DAYS | The retention period to set on Cloudwatch Log groups in days | No | 90 |
To build the lambda function run the following.
npm install
npm run build
To run the tests.
npm test
The following will package the lambda function into a zip bundle to allow manual deployment.
zip -q -r dist/lambda.zip node_modules dist