Reputation: 113
Upvotes: 2
Views: 1052
Reputation: 11
There is no general IoTEvent. The payload will be sent to lambda in a JSON format. So create a POJO class in your lambda with the same variables as the payload. Use your POJO class as the input for your Lambda function. AWS Lambda will automatically map the JSON payload to your POJO class. Check this link for using POJOs for Lambda input. https://docs.aws.amazon.com/lambda/latest/dg/java-handler-io-type-pojo.html
This is the only way I have been able to make this work with Java Lambda. Just make sure the JSON and the POJO match up.
Upvotes: 1