A simple CLI for authoring AWS Lambdas in java
jlambda is a simple command line tool that lets you generate java project with all AWS lambda dependencies built-in. One can simply add business logic to the generated project and use jlambda once again to build a deployment package(.zip) and publish it to AWS . For now jlambda makes use of the AWSs' DefaultCredentialResolver to obtain credentials to publish the lambda
Java developers shy away from authoring AWS Lambda functions in Java owing to the inherent complexity in setting up the project and publishing it. Jlambda hopes to alleviate some or most of that pain. Jlambda is written in java for Java developers.
Usage: jlambda [-h] (-g=<path to generate lambda> | -b=<path to build package
to> | [-p=<publish> [-e=<env>]])
-b, --build=<path to build package to>
-e, --env=<env>
-g, --generate=<path to generate lambda>
-h, --help
-p, --publish=<publish>
Jlambda provides three commands
./jlambda -g /your/path
This will generate a simple gradle java project with AWS Lambda dependencies pre-added. All you have to do is import the project .The Main class(AWS Lambda Handler) is by default at com.lambda.basic.Handler
.It also has a default.properties
file that has all necessary lambda configuration.
<env>.properties
to hold account specific configuration
All that is left is to add logic to your function./jlambda -b /your/path
This will build the java project at the specified location into a deployment package(.zip)../jlambda -p /your/path
will build and publish the deployment package to AWS using the config given in default.properties
. Furthermore , you con use ./jlambda -p /your/path -e <env>
to deploy using environment specific configuration. jlambda.aws.name=
jlambda.aws.handler=
jlambda.aws.role=
jlambda.aws.profile=
jlambda.aws.region=
jlambda.aws.access_key_id=
jlambda.aws.access_key_secret=
jlambda.aws.session_token=
jlambda.aws.mem=
jlambda.aws.timeout=
jlambda.aws.description=
jlambda.aws.subnets=
jlambda.aws.security_groups=
jlambda.aws.tracing_config=
You can download the executable for
P.S. Right now this is tested only in linux