Convert Spring Boot API to AWS Lambda

Jacob Lee
1 min readMay 19, 2020

--

  1. AWS Toolkit for Visual Studio Code
  2. Installing the AWS CLI version 2
  3. Installing the AWS SAM CLI
  4. Add a dependency

4.1 Use Spring Initializr

4.2 Use Maven Repository

5. Add LambdaHandler

6. Create your AWS SAM Template

7. Add Parameters

7. Update build.gradle to create zip file for AWS

8. Validate Cloudformation template

9. Gradle Command

  • Building the project
$./gradlew build
  • Building the archive for CloudFormation deployment

The archive will be generated in build/distributions/demo-0.0.1-SNAPSHOT.zip

$./gradlew buildZip
  • Running stand-alone locally
$./gradlew bootRun
  • Running locally with a local lambda runtime

The project can be run locally with lambda runtime via SAM CLI. The project will start at http://localhost:3000.

$./gradlew lambdaRun
  • Validate CloudFormation templates
$./gradlew validateCF

10. Groovy

https://skryvets.com/blog/2018/06/02/spring-boot-aws-lambda-guide/#create-a-simple-controller

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Jacob Lee
Jacob Lee

No responses yet