8

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!

Community
  • 1
  • 1
Yariv Adam
  • 844
  • 9
  • 24
  • 2
    What happens if you just use `Object` for the input type, schedule an event, and then print the class name? – Mark B Sep 02 '16 at 14:01
  • 2
    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](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html) page. – Yariv Adam Sep 02 '16 at 20:34
  • Then please add this as your answer :) – Efren Mar 08 '18 at 03:37
  • I'd love to, but how? – Yariv Adam Mar 14 '18 at 06:47
  • 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 Mar 24 '18 at 05:58

2 Answers2

2

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.

Yariv Adam
  • 844
  • 9
  • 24
0

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>