AWS Lambda function subscribed to an Amazon MSK topic using IAM auth (Go)

Amazon MSK → AWS Lambda

Creates a Lambda function that uses an Amazon MSK topic as an event source with IAM authentication.

This pattern provides a Lambda function along with an Event Source Mapping to a Kafka topic.
It requires that you already have an Amazon Managed Streaming for Kafka (Amazon MSK) cluster setup with a topic created.
If you don't already have an MSK cluster, you can use the example in this pattern https://serverlessland.com/patterns/msk-cfn-sasl-lambda (linked in the resources) to deploy a cluster.
This pattern works with either a Provisioned or Serverless MSK cluster as long as the cluster is configured to use IAM authentication.
For detailed deployment instructions instructions see the README.

< 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/msk-lambda-iam-go-sam

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the template: sam delete.

Created by:

Vaibhav Jain

Vaibhav Jain

AWS - Sr. Application Architect

Follow on LinkedIn

Paveen Allam

Paveen Allam

Senior Solutions Architect

Follow on LinkedIn

Suraj Tripathi

Suraj Tripathi

AWS - AppDev Cloud Consultant

Follow on LinkedIn

Adam Wagner

Adam Wagner

AWS - Principal Serverless Solutions Architect

Follow on LinkedIn

Indranil Banerjee

Indranil Banerjee

AWS - Senior Solutions Architect

Follow on LinkedIn