I am trying to trigger an AWS lambda function written in Java, on dynamodb stream events. Amazon has a guide for the same, using NodeJS here http://docs.aws.amazon.com/lambd
To obtain the deserialized objects from event handler : 1) In the handler get json from input stream using something like this :
private String getJsonFrom(InputStream stream) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int letter;
while ((letter = stream.read()) != -1)
baos.write(letter);
return new String(baos.toByteArray());
}
2) Then create a specific deserializer derialize the object from json. 'NewImage' in case of DynamoDB event. One example here.