0
votes

I want to write a Lambda Handler in JAVA to read the events of CloudWatch. These Events are coming from Media Convert API.

Steps that I covered:

  1. Configured the eclipse using AWS tool Kit.
  2. Created an AWS Project with a Lambda function.

  3. Doubt begin from here:

    • Which Event type shall I select to make a Lambda Handler as it is showing following options:

    • S3, SNS, Custom, Stream Request Handler, Kinesis Event, Cognito Event.

Note: No mention of Elemental Media Convert type event that are written over CloudWatch Stream.

  • What is Stream Request Handler here? Does it a handler that could be configured to listen Event stream based event. Is it So. If Yes, Kindly help me to figure out this one.

Added Flow:

A) Media Convert service is used to change format of submitted media. b) Documentation states that All events are published on Event stream of CloudWatch, when job status changes.

C) Here, i want to read these events from Event stream of Cloud watch regarding change in job status.

1
What events do you wish to handle? Are they coming from the service itself, or from an Amazon CloudWatch Alarm? Also, please note that Amazon Elastic Transcoder is separate service to the Elemental suite of services.John Rotenstein
Sorry, for mistake, Events are coming from Elemental Media Convert service to CloudWatch on change in Job status.mohneesh
And how is CloudWatch triggering the Lambda function? Is a CloudWatch Alarm being triggered (eg entering ALARM state)?John Rotenstein
I build a rule for scheduled events that targets the respective Lambda functionmohneesh
I am confused. What is the flow, starting with Elemental and ending with Lambda? You say "Events are coming from Elemental" -- what events, where are they going, what do you want to do with them? Feel free to Edit your question to add more details.John Rotenstein

1 Answers

1
votes

You can write a small Lambda function that prints the incoming event to the log file:

def lambda_handler(event, context):
    print (event)
    return

Then, trigger the function via CloudWatch. The function will write the event to the log files. You can examine the logs to see what information was passed into the function.

This will show you the real content of the message. The other message types are simply for testing in case you do not have a trigger setup to create a real event.