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.
Environment Variable | Description | Required |
---|---|---|
DESTINATION_ARN | The destination arn where the logs will be sent | Yes |
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