Skip to content

Lambda function which automatically sets the log destination on CloudWatch log groups

License

Notifications You must be signed in to change notification settings

previewme/cloudwatch-log-destination

Repository files navigation

cloudwatch-log-destination

CI Workflow Coverage Vulnerabilities Quality Gate Status

Lambda function which automatically sets a destination for all newly created Cloudwatch Log groups. When a subscription filter is modified or deleted, the function will add back the expected subscription filter. In the case there are two subscription filters already, the last one is deleted.

This allows us to centralise all of our logs into a single account.

Configuration

Environment variables

Environment Variable Description Required
DESTINATION_ARN The destination arn where the logs will be sent Yes

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 automatically sets the log destination on CloudWatch log groups

Topics

Resources

License

Stars

Watchers

Forks