Skip to content

satyahawb/sample

 
 

Repository files navigation

TU Summer Camp Sample Project

Build Status

The following project should serve as a sample blueprint for creating AWS Lambda-compatible Java-based projects.

Development Environment Setup

Follow the instructions here: https://docs.aws.amazon.com/lambda/latest/dg/java-create-jar-pkg-maven-and-eclipse.html

Use the following artifact information:

  • Group Id: com.visteoncloud
  • Artifact Id: tusc-sample
  • Version: 0.0.1-SNAPSHOT
  • Packaging: jar
  • Name: tusc-sample

Maven Dependencies

You will need the following Maven dependencies

aws-lambda-java-core

  • Group Id: com.amazonaws
  • Artifact Id: aws-lambda-java-core
  • Version: 1.1.0

aws-lambda-java-events

  • Group Id: com.amazonaws
  • Artifact Id: aws-lambda-java-events
  • Version: 2.2.6

maven-shade-plugin

  • Group Id: org.apache.maven.plugins
  • Artifact Id: maven-shade-plugin
  • Version: 2.3

Building Deployment package

From terminal

Execute mvn package shade:shade. This will create a JAR artifact ./target/tusc-sample-0.0.1.jar

From Eclipse

You will need to create a shaded package that is ready for deployment. Create a new Maven build with package shade:shade goal.

Deploy using AWS SAM (Serverless Aplication Model)

# Create package
sam package \
    --template-file template.yaml \
    --output-template-file packaged.yaml \
    --s3-bucket your-s3-bucket

# Deploy package
sam deploy \
    --template-file packaged.yaml \
    --stack-name tusc-sample \
    --capabilities CAPABILITY_IAM

Userful articles

About

AWS Lambda sample project using Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%