Skip to content

oslokommune/okdata-log-group-subscriber

Repository files navigation

okdata-log-group-subscriber

AWS Lambda function for automatically setting up subscriptions to new CloudWatch Log Groups when they are created. Configure the function by setting the following environment variables:

Variable name Description
DESTINATION_ARN ARN of the resource to set up subscriptions for.
FILTER_PATTERN Only log entries matching this pattern are sent to the destination.
[SUBSCRIPTION_WHITELIST] Optional regex. Create subscriptions only for log groups with names matching this.
[SUBSCRIPTION_BLACKLIST] Optional regex. Don't create subscriptions for log groups with names containing this.

Note that CloudTrail logging must be enabled on the AWS account in order for this component to be able to subscribe to CreateLogGroup events.

Tests

Tests are run using tox: make test

For tests and linting we use pytest, flake8 and black.

Deploy

Deploy to both dev and prod is automatic via GitHub Actions on push to main. You can alternatively deploy from local machine with: make deploy or make deploy-prod.

About

Auto-subscribe to CloudWatch Log Groups

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •