An example how to use PantsBuild to start with JAVA based Lambda project
./pants binary lambda/src/java:foobar
Setup a lambda function in AWS. Particularly, the handler is in the format com.example.foobar.main.FoobarMain.handleRequest
The binary is in dist/foobar.jar
, you can modify lambda/scripts/upload_lambda.sh
script to upload the JAR from your CLI. Alternatively, you can do so through the UI.
Test through UI from Lambda, and here is a sample input.
{
"myCount": 1
}
A success output looks like
{
"resp": "1"
}