DEV Community

MichaelZ
MichaelZ

Posted on

Deploying Spring Boot to AWS Lambda with Terraform — Public Demo Project

Hey folks!

I wanted to share a small project I’ve open-sourced recently to help backend developers (like myself) get started with deploying Spring Boot apps to AWS Lambda using Terraform — without wasting days on setup.

It’s based on a public GitHub demo and designed to show how Java, Lambda, and API Gateway can work together in a clean, reproducible way. Literally it deploys in under 3 mins!


What You'll Learn

  • How to write a minimal Spring Boot app for serverless
  • How to define AWS infrastructure using Terraform (Lambda + API Gateway)
  • How to deploy everything with a single script
  • How to test endpoint on AWS

What's Inside the Demo

  • Java 17 + Spring Boot starter project
  • Lambda-compatible handler
  • Infrastructure-as-Code with Terraform
  • API Gateway config
  • Bash deploy script
  • Lightweight README + setup guide

GitHub repo:

https://github.com/ZPetrovich/springboot-aws-template-demo

1-minute walkthrough video:

https://www.youtube.com/watch?v=agKj_un5PZg


How to Try It Yourself

git clone https://github.com/ZPetrovich/springboot-aws-template-demo
cd springboot-aws-template-demo
chmod +x deploy.sh
./deploy.sh
Enter fullscreen mode Exit fullscreen mode

You'll need:

  • Java 17+
  • AWS CLI + credentials
  • Terraform 1.x+

Once deployed, test the endpoint in your Browser:

https://<YOUR_AWS_GATEWAY_ID>.execute-api.<YOUR_AWS_REGION>.amazonaws.com/prod/api/items/YOUR_KEYWORD

The goal is to reduce the DevOps burden for solo developers, learners, and backend engineers who want to experiment with Lambda.

If this project helps you, or if you see anything that could be improved — I’d love to hear from you.

I'm happy to expand it further (add CI/CD, DynamoDB, multi-environment support, etc.) if there's interest.

Thanks for reading!

API Gateway

Top comments (0)