Skip to content

Instantly share code, notes, and snippets.

@dalmat36
Created April 9, 2016 20:43
Show Gist options
  • Save dalmat36/9027c5df3e8fc730bf7c4ea59e825f46 to your computer and use it in GitHub Desktop.
Save dalmat36/9027c5df3e8fc730bf7c4ea59e825f46 to your computer and use it in GitHub Desktop.
Hello AWS Lambda with Groovy
package testing
import com.amazonaws.services.lambda.runtime.Context
import org.bson.Document;
public class Hello {
public List<Document>; myHandler(People people, Context context) {
def listOfPeople = []
Document person1 = new Document().append("name", people.person1)
listOfPeople.add(person1)
Document person2 = new Document().append("name", people.person2)
listOfPeople.add(person2)
Document person3 = new Document().append("name", people.person3)
listOfPeople.add(person3)
return listOfPeople
}
}
{
"person1":"Matt",
"person2":"Geoff",
"person3":"Max"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment