AWS Lambda
The Lambda adapter accepts API Gateway HTTP API payload v2.0, API Gateway REST API payload v1.0, and Lambda Function URLs without configuration. It handles base64 bodies, v2 cookies, v1 multiValueHeaders, and forwards method, path, query, and headers into a standard Request.
When to choose Lambda
- You already run on AWS and want IAM-integrated invocation.
- You want per-request billing without managing a server.
- You need long timeouts (up to 15 minutes) or larger memory than edge functions allow.
Install
The adapter ships with @daloyjs/core. For deployment, use AWS SAM, CDK, the Serverless Framework, or any IaC of your choice.
Function URL or API Gateway HTTP API
Streaming responses
Lambda supports response streaming via awslambda.streamifyResponse. Use the streaming variant of the adapter when you need to flush headers and bytes incrementally (Server-Sent Events, large downloads).
SAM template
DaloyJS requires Node 24+ (engines.node >= 24.0.0). Use the nodejs24.xmanaged runtime where available, or ship a container image (see Lambda Web Adapter below) if your region's runtime catalog is older.
Lambda Web Adapter (container deployments)
If you prefer to ship a container image and keep the Node adapter, the AWS Lambda Web Adapter translates Lambda invocations to plain HTTP. Useful when you want one image for both ECS and Lambda.
Gotchas
- Callback-style handlers (
(event, context, callback) => ...) are not supported on Node 24+. Always useasynchandlers; the DaloyJS adapter does. - For Function URLs with streaming, set
InvokeMode: RESPONSE_STREAMand usetoLambdaStreamHandler. - Cold starts: prefer the Node adapter on provisioned concurrency or use a container with the Web Adapter for warmer reuse.
See also
- Adapters overview
- Netlify Functions— v1 still uses the same Lambda event shape if you need it.
- Streaming (SSE & NDJSON)