Skip to content

addmaths07/aws-lambda-java-boilerplate-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda Boilerplate for JAVA, Spring IoC & Hibernate

This repository is in extension to cagataygurturk work.

Do you miss JAVA, its great features and all Spring framework sugar in AWS Lambda? Use this boilerplate code to author JAVA functions in Lambda and enjoy all features of Spring IoC. It also supports local debugging of JAVA functions.

Usage

The code is already documented. MainHandler is the main entrance point of your lambda function. services package includes Spring Beans. For default, MainHandler fetches Service Bean from IoC container but once you have Service instance you can use Autowiring features.

You can configure your IDE to run com.example.lambda.local.LocalRunner as Main Class and com.cagataygurturk.lambda.MainHandler as program argument to debug locally your function.

Deployment

In root folder fire

mvn package -Denv=production

This creates a JAR package in target folder.

As you can see in pom.xml, "-Denv=production" activates production profile and it excludes aws-lambda-local-runner dependency from deployment package in order to get rid of a unnecessary dependency which is not needed in production environment. Forgetting this does not affect the project but it increases JAR package size.

You can upload the created JAR folder to AWS Lambda console. Handler function should be configured to com.cagataygurturk.example.lambda.MainHandler.

Planned features

  • A tool like Serverless that will use Cloudformation and Maven for Lambda and API Gateway deployments is under development.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages