By using AWS re:Post, you agree to the Terms of Use
/Pass Cloudwatch Event Data to Lambda Function/

Pass Cloudwatch Event Data to Lambda Function


Is there an example for how to structure the Lambda function to use data that is passed from a triggered Cloudwatch event.

I have my Lambda function as the target of the event, and I have matched event as the input. but I do not know how to take one of those fields and make it a usable variable.

2 Answers

There is a Java example here -

This example shows how different types of events can be handled in lambda and Cloudwatch Events is one of the examples.

Note that Cloudwatch events has now been integrated into a service called Eventbridge

There is a good AWS workshop that provides good hands-on practice with Eventbridge over here -

This particular section in the above workshop shows lambda integration with Eventbridge

There is also a tutorial in the AWS documentation that shows how to integrate Lambda with Eventbridge over here -

answered 20 days ago


Using SNS as a trigger to the Lambda function for the CloudWatch Event. It provides a message that is sent to a SNS Topic. When the SNS triggers the Lambda Function, the message event can be obtained by a Lambda code. From that you can tap into the message dictionary and get the values needed.

The below link shows how you can get the message from the SNS topic

answered 19 days ago
  • Cloudwatch Events (now merged into Eventbridge) can directly be consumed by lambda, without having to go through SNS. What extra value is SNS adding, unless the customer wants to send out emails or SMS messages?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions