
Web Applications / REST APIs
With a server, VM or a container service, when you write an API, and you expose it with an HTTP server listening to a port. Application frameworks like Spring Boot convert HTTP requests to Java objects, and your application code runs and responds.
You can't make an HTTP request directly to a Lambda function because it can't accept in-bound connections. You can still build HTTP APIs with Lambda, by using services such as Amazon API Gateway and Application Load Balancer (ALB) that receive HTTP requests and integrate with Lambda. They convert the HTTP request to JSON and call the Lambda function's invoke API.

There are two common patterns used to re-platform applications with minimal code changes.
The AWS Lambda Web Adapter is a Lambda Extension that you configure to be used with your Lambda function. It takes an HTTP request as a JSON event and uses it to make an HTTP request for your application. The advantage of this approach is that your application code doesn't need to change at all. The disadvantage is that you have to initialize an HTTP server, which isn't strictly needed. This extends the first invoke latency and increases memory used.

The AWS Serverless Java Container is a Java library that you add to your application as a dependency.

You add a new class to your application that implements the Lambda request handler interface. This will be the entry point to your function.

This has a reference to your Spring application class (Struts, Jersey, and Spark also supported) when Lambda initializes your function, it will also initialize your Spring application.
The From Serverful to Serverless Java with AWS Lambda workshop gives you a step-by-step guide of how to migrate a Spring Boot application to Lambda using the AWS Serverless Java Container library.