Amazon EventBridge to Amazon CloudWatch Logs

EventBridge → CloudWatch Logs

Create an EventBridge rule that sends events to CloudWatch Logs

This project contains a sample AWS CDK template to create an EventBridge Rule, as well as, a CloudWatch Logs Group. The EventBridge Rule publishes matched events to CloudWatch Logs. In this example, the rule filters for specific attributes in the event before sending to the CloudWatch Logs target. Note: CDK may automatically create a Custom Resource Lambda to set certain policy configurations for CloudWatch Logs.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-cloudwatch-cdk

Deploy

See the GitHub repo for detailed deployment instructions.


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Shehryar Abbasi

Shehryar Abbasi

Senior DevOps Cloud Architect at AWS.

Follow on LinkedIn