Skip to content

Instantly share code, notes, and snippets.

@mikebroberts
Created October 24, 2017 21:23
Show Gist options
  • Save mikebroberts/8a02d27155d8e91f9b44a8dd356fcca7 to your computer and use it in GitHub Desktop.
Save mikebroberts/8a02d27155d8e91f9b44a8dd356fcca7 to your computer and use it in GitHub Desktop.
Java AWS Lambda to log inbound event - useful when you don't know what structure an event has
package io.symphonia;
import java.io.InputStream;
import java.io.OutputStream;
public class WhatIsMyLambdaEvent {
public void handler(InputStream is, OutputStream os) {
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
System.out.println(s.hasNext() ? s.next() : "No input detected");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment