aws
aws-lambda-web-adapter
Rust

Run web applications on AWS Lambda

Last updated Jul 10, 2026
2.7k
Stars
156
Forks
59
Issues
+4
Stars/day
Attention Score
89
Language breakdown
Rust 98.3%
Makefile 1.2%
JavaScript 0.4%
Dockerfile 0.1%
Shell 0.0%
โ–ธ Files click to expand
README

AWS Lambda Web Adapter

A tool to run web applications on AWS Lambda

AWS Lambda Web Adapter allows developers to build web apps (http api) with familiar frameworks (e.g. Express.js, Next.js, Flask, SpringBoot, ASP.NET and Laravel, anything speaks HTTP 1.1/1.0) and run it on AWS Lambda. The same docker image can run on AWS Lambda, Amazon EC2, AWS Fargate, and local computers.

Lambda Web Adapter

๐Ÿ“– Read the full User Guide

Features

  • Run web applications on AWS Lambda
  • Supports Amazon API Gateway Rest API and Http API endpoints, Lambda Function URLs, and Application Load Balancer
  • Supports Lambda managed runtimes, custom runtimes and docker OCI images
  • Supports Lambda Managed Instances for multi-concurrent request handling
  • Supports any web frameworks and languages, no new code dependency to include
  • Automatic encode binary response
  • Enables graceful shutdown
  • Supports response payload compression
  • Supports response streaming
  • Supports multi-tenancy via tenant ID propagation
  • Supports non-http event triggers

Quick Start

Docker Images

Add one line to your Dockerfile:

COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:1.0.1 /lambda-adapter /opt/extensions/lambda-adapter

Pre-compiled multi-arch images (x8664 and arm64) are available at public.ecr.aws/awsguru/aws-lambda-adapter. Non-AWS base images may be used since the Runtime Interface Client ships with the Lambda Web Adapter.

๐Ÿ‘‰ Docker Images guide

Zip Packages

  • Attach the Lambda Web Adapter layer to your function:
- x86_64: arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerX86:28 - arm64: arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerArm64:28
  • Set environment variable AWSLAMBDAEXEC_WRAPPER to /opt/bootstrap
  • Set function handler to your startup script, e.g. run.sh
๐Ÿ‘‰ Zip Packages guide (includes AWS China region ARNs and Windows caveats)

Configurations

The readiness check port/path and traffic port can be configured using environment variables. These environment variables can be defined either within docker file or as Lambda function configuration.

| Environment Variable | Description | Default | |-----------------------------------------|---------------------------------------------------------------------------------|--------------| | AWSLWAPORT | traffic port (falls back to PORT) | "8080" | | AWSLWAREADINESSCHECKPORT | readiness check port | AWSLWAPORT | | AWSLWAREADINESSCHECKPATH | readiness check path | "/" | | AWSLWAREADINESSCHECKPROTOCOL | readiness check protocol: "http" or "tcp" | "http" | | AWSLWAREADINESSCHECKHEALTHY_STATUS | HTTP status codes considered healthy (e.g., "200-399") | "100-499" | | AWSLWAASYNC_INIT | enable asynchronous initialization for long initialization functions | "false" | | AWSLWAREMOVEBASEPATH | the base path to be removed from request path | None | | AWSLWAENABLE_COMPRESSION | enable gzip/br compression for response body (buffered mode only) | "false" | | AWSLWAINVOKEMODE | Lambda function invoke mode: "buffered" or "responsestream" | "buffered" | | AWSLWAPASSTHROUGHPATH | the path for receiving event payloads from non-http triggers | "/events" | | AWSLWAAUTHORIZATION_SOURCE | a header name to be replaced to Authorization | None | | AWSLWAERRORSTATUSCODES | HTTP status codes that will cause Lambda invocations to fail (e.g. "500,502-504") | None | | AWSLWALAMBDARUNTIMEAPIPROXY | overwrites AWSLAMBDARUNTIMEAPI to allow proxying request | None |

Deprecation Notice: The following non-namespaced environment variables are deprecated and will be removed in version 2.0:
HOST, READINESSCHECKPORT, READINESSCHECKPATH, READINESSCHECKPROTOCOL, REMOVEBASEPATH, ASYNC_INIT.
Please migrate to the AWSLWA prefixed versions. Note: PORT is not deprecated and remains a supported fallback for AWSLWAPORT.
>
Additionally, AWSLWAREADINESSCHECKMINUNHEALTHYSTATUS has been removed in 1.0. Use AWSLWAREADINESSCHECKHEALTHY_STATUS instead.

๐Ÿ‘‰ Detailed configuration docs

Examples

๐Ÿ‘‰ Examples organized by language

Acknowledgement

This project was inspired by several community projects.

Migrating from 0.x to 1.0

Environment Variables

All environment variables now use the AWSLWA prefix. The old non-prefixed names still work but are deprecated and will be removed in version 2.0.

| Old (Deprecated) | New | |------------------------------|--------------------------------------------| | READINESSCHECKPORT | AWSLWAREADINESSCHECKPORT | | READINESSCHECKPATH | AWSLWAREADINESSCHECKPATH | | READINESSCHECKPROTOCOL | AWSLWAREADINESSCHECKPROTOCOL | | REMOVEBASEPATH | AWSLWAREMOVEBASEPATH | | ASYNCINIT | AWSLWAASYNCINIT |

Note: PORT is not deprecated and remains a supported fallback for AWSLWAPORT.

Readiness Check Health Status

AWSLWAREADINESSCHECKMINUNHEALTHYSTATUS has been removed. Use AWSLWAREADINESSCHECKHEALTHY_STATUS instead, which accepts comma-separated codes and ranges:

# Old
AWSLWAREADINESSCHECKMINUNHEALTHYSTATUS=400

New (equivalent)

AWSLWAREADINESSCHECKHEALTHY_STATUS=100-399

Similar Projects

Several projects also provide similar capabilities as language specific packages/frameworks.

Security

See SECURITY for vulnerability reporting and CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท aws/aws-lambda-web-adapter ยท Updated daily from GitHub