Skip to content

Using a subscription filter and lambda to filter logs to a new log group

Notifications You must be signed in to change notification settings

perpil/lambda-bifurcate-logs-cdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bifurcating Lambda Logs

This is a companion repo for this blog on bifurcating lambda logs.

Key files

The Service Application The Request Log Writing Lambda The CDK stack with Subscription Filter and Function Url

Installation

  1. Install Cargo Lambda
  2. npm install
  3. npm run build

Deployment

  1. npx cdk synth
  2. npx cdk deploy

Running

Hit the url that appears in the output of the deploy command above to trigger a request. To see the logs, there are two log groups, the original logs are in:

/aws/lambda/airline-service

and the filtered request logs are in:

/aws/lambda/airline-service-requestlogs

Cleanup

When you are done, you can delete the resources by running

  1. npx cdk destroy

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npx cdk deploy deploy this stack to your default AWS account/region
  • npx cdk diff compare deployed stack with current state
  • npx cdk synth emits the synthesized CloudFormation template

About

Using a subscription filter and lambda to filter logs to a new log group

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published