To build a Rest API that lets a client app (for example, a React APP) invoke Lambda functions via API Gateway, you should look at using the AWS CDK to create API Gateway endpoints.

Then you can use the AWS SDK for Java to implement Lambda functions that perform various AWS Service operations. For example, save data in an Amazon DynamoDB table.

Because there is a lot of detail involved in how to do this use case, this is a detailed end to end AWS App example. Consider this architecture illustration:

In this use case, the API Gateway REST API was created via the AWS CDK and the AWS SDK for Java v2 API was used to invoke AWS Service opertions and were implemented as Lambda functions.

To see the complete details, including the CDK Script (note that the link to the CDK script is located near end of the doc), see:

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/pam_source_files

If you spend time reading this and going through all the code, you will gain a much deeper undertanding how all of these pieces fit together. The final app looks like:

First it requires you to log in which authenticates with Cognito:

Then it invokes various AWS Service operations and displays a tag count of objects located in an S3 bucket:

Answer from smac2020 on Stack Overflow
🌐
Baeldung
baeldung.com › home › cloud › using aws lambda with api gateway
Using AWS Lambda with API Gateway | Baeldung
January 8, 2024 - In two previous articles, we discussed ... using Java, as well as how to access DynamoDB from a Lambda function. In this tutorial, we’ll discuss how to publish a Lambda function as a REST endpoint, using AWS Gateway. We’ll have a detailed look at the following topics: ... API Gateway is ...
Discussions

Converting Rest Controller Java App Into Lambda
That annotated controller will not help you and you don't need it. You need a Class that can handle the AWS Lambda call. Import the SDK and watch some examples. Remember AWS Lambda just call the class::method that you define in its configuration. If you want to expose this as an API I would use AWS API Gateway to define the routes, resources, methods and make it trigger a call to your AWS Lambda More on reddit.com
🌐 r/aws
24
3
August 15, 2022
amazon web services - Fetch rest api data using aws lambda in java springboot application - Stack Overflow
I am able to find codes for handler ... fetching rest api data using aws lambda in java ... An AWS Lambda function is basically a shell for running whatever code you want. So, look for some code that fetches data (without using Lambda) and then insert that code into the Lambda function. – John Rotenstein Commented Feb 8, 2024 at 11:20 · I put some code up for a simple example that is a ... More on stackoverflow.com
🌐 stackoverflow.com
Integration of REST API with Lambda
For the most recent update on ongoing ... to the AWS Health Dashboard. For information on AWS Service migration, see How do I migrate my services to another region? ... Hello, I'm developing a REST API with API GW and Lambda (Java Runtime).... More on repost.aws
🌐 repost.aws
2
0
January 1, 2024
API Gateway with REST endpoints as Lambda functions: how to get singleton like behavior ?
I fully agree with you when you're ... in AWS. Hence, I think that the API Gateway should have a way to say that the exposed API has a request, session or application scope, as this is the case of any REST endpoint. However, I didn't find any such functionality. ... If you run your Java application, with a static block, on two different servers, do you still expect it to be the same memory? It is not. Same is for Lambda ... More on repost.aws
🌐 repost.aws
6
0
March 31, 2023
🌐
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with java › java sample applications for aws lambda
Java sample applications for AWS Lambda - AWS Lambda
The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda. Each sample application includes scripts for easy deployment and cleanup, an CloudFormation template, and supporting resources.
🌐
Quarkus
quarkus.io › guides › aws-lambda-http
AWS Lambda with Quarkus REST, Undertow, or Reactive Routes - Quarkus
If you want to use the AWS Gateway REST API, generate your project with this script: mvn archetype:generate \ -DarchetypeGroupId=io.quarkus \ -DarchetypeArtifactId=quarkus-amazon-lambda-rest-archetype \ -DarchetypeVersion=3.32.4 ... This will ...
🌐
AWS
aws.amazon.com › blogs › opensource › java-apis-aws-lambda
Running APIs Written in Java on AWS Lambda | AWS Open Source Blog
January 16, 2021 - Serverless Java Container makes it easy to take an application written in Java with frameworks such as Spring, Spring Boot, Jersey, or Spark and run it inside AWS Lambda with minimal code changes. The Serverless Java Container library acts as a proxy between the Lambda runtime and the framework of your choice, pretends to be a servlet engine, translates incoming events to request objects that frameworks can understand, and transforms responses from your application into a format that API Gateway understands.
🌐
FINRA
finra.org › about › technology › blog › creating-simple-rest-service-aws-lambda-api-gateway-iam
Creating A Simple REST Service Using AWS Lambda, API Gateway, And IAM | FINRA.org
April 28, 2016 - In our example, we’ll use the RequestResponse invocation method over HTTPS using API Gateway. In this example, we invoke the myHandler Java function over REST using the API Gateway.
🌐
Medium
medium.com › @javatechie › deploying-spring-boot-applications-to-aws-lambda-with-api-gateway-ae5c810008e5
Deploying Spring Boot Applications to AWS Lambda with API Gateway | by Java Techie | Medium
July 5, 2024 - This example will focus on creating a course service with CRUD (Create, Read, Update, Delete) functionality for managing courses. let’s start creating course DTO class with field id, name & price as below · package com.javatechie.dto; import ...
Find elsewhere
🌐
Reddit
reddit.com › r/aws › converting rest controller java app into lambda
r/aws on Reddit: Converting Rest Controller Java App Into Lambda
August 15, 2022 -

I'm trying to implement an app into AWS Lambda. It's currently one of those apps that uses @RestController and @PostMapping to create an API interface with multiple functions, but I'm trying to get it on Lambda. I know I must build a handler, but I'm not 100% sure how to do that.

Any help would be greatly appreciated.

EDIT: Going to clarify some details. The app is a Java application I was given, and it uses a Spring Boot Rest API. I need to covert it for API Gateway & Lambda, and I’m not sure how to do that, especially since the functions use specifically made JSONs, and I’m not 100% sure how to get it to work in this case.

🌐
Stack Overflow
stackoverflow.com › questions › 77961086 › fetch-rest-api-data-using-aws-lambda-in-java-springboot-application
amazon web services - Fetch rest api data using aws lambda in java springboot application - Stack Overflow
I am able to find codes for handler https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic but no code for fetching rest api data using aws lambda in java ... An AWS Lambda function is basically a shell for running whatever code you want. So, look for some code that fetches data (without using Lambda) and then insert that code into the Lambda function. – John Rotenstein Commented Feb 8, 2024 at 11:20 · I put some code up for a simple example that is a "raw" Lambda, without the spring extras.
🌐
Javatodev
javatodev.com › aws-serverless-crud-api-functions-with-java
How to develop AWS Lambda Serverless CRUD API With Java
April 10, 2023 - Learn how to develop a Serverless CRUD API with AWS Lambda and Java. This step-by-step guide covers everything you need to build and deploy a serverless application using AWS Lambda and Java.
🌐
GitHub
github.com › aws-samples › aws-sam-java-rest
GitHub - aws-samples/aws-sam-java-rest: A sample REST application built on SAM and DynamoDB that demonstrates testing with DynamoDB Local.
... Events: GetOrders: Type: Api ...-10-31.md#api Properties: Path: /orders Method: get · AWS Lambda Java runtime accepts either a zip file or a standalone JAR file - We use the latter in this example. SAM will use CodeUri property to know where to look up for both application and dependencies: ... GetOrdersFunction: Type: AWS::Serverless::Function Properties: CodeUri: target/aws-sam-java-rest-1.0.0.jar ...
Starred by 439 users
Forked by 152 users
Languages   Java 96.7% | Python 3.3% | Java 96.7% | Python 3.3%
🌐
AWS re:Post
repost.aws › questions › QUwD4GMi2ZQQGnFODz-_3lsw › integration-of-rest-api-with-lambda
Integration of REST API with Lambda | AWS re:Post
January 1, 2024 - Option 3. is probably the way to go if you consider other aspects: Lambda does the "undifferentiating heavyweight lifting" for you (scaling, resiliency, runtime patching, etc.). Additionally, it allow very granular security (per lambda - It is harder to do with any Java AS like Tomcat)
🌐
Geeky Hacker
geekyhacker.com › home › java › getting started with aws lambda and api gateway to building rest apis
Getting started with AWS Lambda and API gateway to building Rest APIs -
June 5, 2024 - In this section, we focus on how to create a Lambda function in the AWS console and upload our hello world example. Then we create an API Gateway and hook it up with the Lambda function. To create a Lambda function in AWS, first, we need to go to the AWS console, then select the data center that we want to create the Lambda function. After that search for Lambda in the search box. Once we are the in the page, need to click on create function button and select Author from scratch option. Write down the function name and select Java 8 as runtime,
🌐
GitHub
github.com › TechPrimers › aws-lambda-api-java-example
GitHub - TechPrimers/aws-lambda-api-java-example: AWS Lambda API Java Example using API Gateway trigger
This example code is used for running a Java Lambda using API Gateway trigger. It uses AWS Lambda Core SDK for RequestHandler implementation which is called by the trigger
Starred by 8 users
Forked by 22 users
Languages   Java 100.0% | Java 100.0%
🌐
DEV Community
dev.to › aws-heroes › serverless-applications-on-aws-using-lambda-with-java-25-api-gateway-and-dynamodb-part-1-sample-4hdg
Serverless applications on AWS using Lambda with Java 25, API Gateway and DynamoDB - Part 1 Sample application - DEV Community
1 week ago - At the end, we define the event to invoke this particular Lambda function. As we use a REST application and API Gateway in front, we define the HTTP method get and the path /products/{id} for it.
🌐
AWS
docs.aws.amazon.com › amazon api gateway › developer guide › amazon api gateway tutorials and workshops › amazon api gateway rest api tutorials › choose an aws lambda integration tutorial › tutorial: create a rest api with a lambda proxy integration
Tutorial: Create a REST API with a Lambda proxy integration - Amazon API Gateway
Lambda function by using the API Gateway console. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway ... If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build.
🌐
AWS re:Post
repost.aws › questions › QUD_LKeE8kTr2NU9PpvFCEzw › api-gateway-with-rest-endpoints-as-lambda-functions-how-to-get-singleton-like-behavior
API Gateway with REST endpoints as Lambda functions: how to get singleton like behavior ? | AWS re:Post
March 31, 2023 - In this context, calling different Lambda functions shoud behave exactly like calling the same instance of the same Lambda function. This is because these Lambda functions are mapped to Java classes which are subclasses of the same static superclass. But, as you're saying, things don't happen this way and, hence, AWS Lambda don't respect the Java basic inheritance and instatiation rules.
🌐
DEV Community
dev.to › aws-heroes › quarkus-3-application-on-aws-lambda-part-8-rest-api-application-3p4
Quarkus 3 application on AWS Lambda- Part 8 REST API application - DEV Community
October 9, 2025 - The mapping itself, for example, for the GetProductByIdFunction Lambda function, works this way: GetProductByIdFunction: Type: AWS::Serverless::Function Properties: FunctionName: GetProductByIdWithWithQuarkus324Rest Events: GetRequestById: Type: Api Properties: RestApiId: !Ref MyApi Path: /products/{id} Method: get
🌐
Google Groups
groups.google.com › g › u6whxwlab › c › 0jD4Xzo-Kwk
Aws Lambda Java Rest Api Example
AWS API Gateway provides a control panel to define REST API using visual designer. When asked to specify a test type, select a standard API call. Choose required details like AWS region where it will be deployed, lambda function name, required memory etc. This is the first tutorial I came across that explained serverless framework so eloquently. There are many options for deploying Java applications in AWS Lambda.