AWS Lambda event filtering using event source mapping for Amazon MSK

Amazon MSK → AWS Lambda

Sample Lambda ESM Filter rules for Amazon Managed Streaming for Apache Kafka (Amazon MSK)

Use this code to test out different trigger filters for your Lambda functions. You can use event filtering to control which events Lambda sends to your function for processing.
Use this template to explore and test how to configure event filtering for Amazon MSK messages triggering a lambda function.

< 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/lambda-esm-msk-filters-sam

Deploy

sam buildsam deploy --stack-name lambda-msk-esm-stack --resolve-s3 --capabilities CAPABILITY_IAM --no-fail-on-empty-changeset --parameter-overrides MSKStreamARN='ClusterARN' MSKTopicName='TopicName'


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name lambda-msk-esm-stack.

Additional resources

Created by:

Nikhil Penmetsa

Nikhil Penmetsa is a Senior Solutions Architect based out of Portland, OR.

Follow on LinkedIn