8
votes

This was asked here but no answer was provided. What is the parameter type passed to a Lambda function (in Java) by a CloudWatch scheduled event?

In this it says the input type would be one of "Predefined AWS event types defined in the aws-lambda-java-events library.". But this library, as I see here, doesn't define a scheduled or cloudwatch event type.

Any assistance would be very much appreciated!

2
What happens if you just use Object for the input type, schedule an event, and then print the class name?Mark B
Great, that worked! Probably should have thought if that... It turns out the parameter is a LinkedHashMap with the keys and values according to what's defined at the very bottom of this page.Yariv Adam
Then please add this as your answer :)Efren
I'd love to, but how?Yariv Adam
Comments can't be marked as answers. I'll add an answer and quote your comment there. But other than that, all I can do is upvote your comment.Yariv Adam

2 Answers

2
votes

Following Mark B.'s comment, it turns out the parameter is a LinkedHashMap with the keys and values according to what's defined at the very bottom of this page.

0
votes

It should be something compatible with JSON so that it works with any language supported by AWS Lambda. I'm guessing it's the same as event object, therefore try Map<String, Object>