Skip to content

leozc/lambda_java_example_pantsbuild

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An example how to use PantsBuild to start with JAVA based Lambda project

To Build

./pants binary lambda/src/java:foobar

Setup a Lambda

Setup a lambda function in AWS. Particularly, the handler is in the format com.example.foobar.main.FoobarMain.handleRequest

Upload the binary

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.

To test

Test through UI from Lambda, and here is a sample input.

{
  "myCount": 1
}

A success output looks like

{
  "resp": "1"
}