Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

You can run a compatible legacy web application on AWS Lambda without changing its application source by using the AWS Lambda Web Adapter. The adapter starts alongside the app, checks that it is ready, forwards Lambda events to it as HTTP requests, and translates its HTTP responses back into Lambda responses. The adapter guide describes this as “zero code changes,” but that claim concerns application code—not packaging, deployment, permissions, or configuration.

Choose the integration that matches how the application receives work

“Plugging in” a legacy application can mean different things. An HTTP server, a Lambda handler, and a background consumer do not share the same invocation interface. Start with the application’s existing interface, then select the bridge that fits it.

Path Best fit What can remain unchanged What you must add or configure Main trade-off
AWS Lambda Web Adapter An existing web application that serves HTTP Application source code, if the app is compatible with the adapter’s runtime and deployment model Packaging or container/runtime setup, adapter extension, app startup and readiness, port configuration, and Lambda deployment Keeps the HTTP application model, while introducing Lambda and adapter configuration requirements.
API Gateway proxy integration A Lambda handler built to consume API Gateway events The client-facing HTTP request can remain conventional API route and method integration, invoke permission, and a handler that accepts the event and returns the expected response format Requires less request mapping, but the function must implement API Gateway’s event and response contract.
API Gateway custom integration A Lambda handler whose input or output shape differs from the API’s The client API shape can be retained Explicit request and response mappings Offers more translation control, with more configuration to maintain.
Queue or stream event source mapping Background work triggered by messages or records The producer/consumer boundary can remain asynchronous Source integration, batch and error/retry settings, and idempotent processing Delivery is at least once, so duplicate work must be safe.

These are not interchangeable routes. The Web Adapter bridges an HTTP application to Lambda. API Gateway connects an HTTP API to a Lambda handler. Event source mappings invoke a function from supported queues and streams in batches. Choose according to the app’s interface and whether the workload needs a synchronous response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run an existing HTTP application with the Lambda Web Adapter

If the legacy application already runs an HTTP server, the AWS Lambda Web Adapter User Guide is the most direct path to preserving its source code. The adapter runs as a Lambda extension: it starts with the application, waits for readiness, passes incoming Lambda events to the application’s HTTP server, and turns the server’s response into a Lambda response.

In practical terms, the app continues to handle HTTP requests rather than being rewritten as a Lambda handler. The deployment still has to include and configure the adapter and application. The app’s startup behavior, listening port, readiness behavior, runtime, dependencies, and packaging must fit the chosen Lambda deployment. The guide’s general zero-code-change statement does not establish that a particular framework, operating-system dependency, architecture, or state model will work unchanged; verify those against the adapter’s documented requirements.

Use API Gateway when the Lambda function is the HTTP integration

API Gateway does not, by itself, turn an arbitrary legacy executable or HTTP server into a Lambda function. It invokes Lambda using an event representation. The function must be a Lambda handler that can consume that event, or a separate bridge must adapt the application’s interface.

Proxy integration: the handler owns the event contract

With a Lambda proxy integration, API Gateway passes request details in a structured event. The function must return the response shape API Gateway expects; a legacy HTTP server’s ordinary HTTP response is not automatically that Lambda response. See AWS’s documentation for Lambda proxy integrations and invoking Lambda through an API Gateway endpoint.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This option suits a handler designed for API Gateway events. It can preserve a conventional client-facing HTTP API, but it does not remove the need for a compatible handler and response format.

Custom integration: map between API and handler formats

When the handler expects a different input or produces a different output shape, API Gateway custom integration can use mapping templates to translate the request and response. This gives you control over the boundary, but the mappings become part of the integration configuration and need to be maintained. AWS describes the available Lambda integrations for REST APIs.

For either API Gateway approach, configure the route and method integration and grant API Gateway permission to invoke the function. The required permission and event/response setup are part of the integration, not optional consequences of leaving the application source alone.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use event source mappings for queue- and stream-driven work

If the application processes messages or records rather than serving HTTP requests, a queue or stream integration may be more appropriate than an API. Lambda event source mappings read supported sources and invoke the function with batches of records. This is an asynchronous processing path, not a substitute for a synchronous HTTP request/response flow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AWS states that delivery is at least once, so a record may be processed more than once. Design the consumer to be idempotent: repeating a record should not create a second charge, duplicate order, or other unintended side effect. Account for batch behavior, errors, and retries in the source integration and processing logic. See how Lambda processes records from stream and queue-based event sources.

Decide whether “without changing code” fits your constraints

  1. Identify the current interface. Determine whether the application serves HTTP, is already a Lambda handler, or consumes queue/stream messages. An HTTP app points toward the Web Adapter; message-driven work points toward an event source mapping; an API invoking a handler points toward API Gateway.
  2. Define what may change. Confirm whether “no code changes” means only leaving application source untouched, or also forbids changing packaging, deployment configuration, extensions, permissions, and infrastructure. The Web Adapter’s claim supports the former, not the latter.
  3. For API Gateway, check the handler contract. Use proxy integration if the handler can accept the API Gateway event and return its required response shape. Use custom integration if request and response mapping is needed. If the existing program is only an HTTP server, API Gateway alone does not bridge it into a Lambda handler.
  4. For asynchronous work, plan for duplicates. Before enabling a queue or stream trigger, decide how processing will remain safe when records are delivered again, and configure batch and retry behavior for the workload.
  5. Validate the actual deployment. Check runtime and dependency compatibility, application startup and readiness, port settings, permissions, networking, timeouts, and operational limits under the target configuration. General integration documentation cannot establish compatibility for every legacy application’s framework, operating-system dependencies, state assumptions, or workload.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.