Architecture
Overview
AWS Lambda Web Adapter is a Lambda Extension that bridges the gap between Lambda's event-driven invocation model and traditional HTTP web applications.
Supported Triggers
- Amazon API Gateway REST API
- Amazon API Gateway HTTP API (v2 event format)
- Application Load Balancer (ALB)
- Lambda Function URLs
- Non-HTTP triggers (SQS, SNS, S3, DynamoDB, Kinesis, Kafka, EventBridge, Bedrock Agents) via pass-through
Request Flow
- Lambda receives an event from a trigger (API Gateway, ALB, Function URL, etc.)
- The adapter converts the Lambda event into a standard HTTP request
- The HTTP request is forwarded to your web application on the configured port
- Your app processes the request and returns an HTTP response
- The adapter converts the HTTP response back into a Lambda event response
- Lambda returns the response to the caller
Extension Lifecycle
The adapter runs as a Lambda Extension (since v0.2.0):
- Init phase: Lambda starts the adapter extension and your web application process
- Readiness check: The adapter polls your app until it responds (every 10ms)
- Invoke phase: The adapter starts the Lambda runtime client and forwards events
- Shutdown phase: Lambda sends SIGTERM, allowing graceful shutdown
When running outside Lambda (EC2, Fargate, local), the adapter does not start — your app runs as a normal web server.
Binary Response Encoding
The adapter automatically detects binary responses based on the Content-Type header and encodes them appropriately for the Lambda response format.
Technology Stack
- Written in Rust
- Built on AWS Lambda Rust Runtime (
lambda_httpcrate) - Uses
hyperas the HTTP client - Uses
towerfor middleware (compression) - Compiled to static musl binaries for x86_64 and aarch64