I tried out Lambda Web Functions, which became GA, in the Tokyo region
話題の記事

I tried out Lambda Web Functions, which became GA, in the Tokyo region

AWS Lambda Web Functions, available in 5 regions including Tokyo, let me deploy an Express app. One command gave a public URL, and SSE events arrived sequentially at ~1-second intervals.
2026.10.13

This page has been translated by machine translation. View original

Introduction

On October 12, 2026, AWS Lambda Web Functions became GA (Generally Available).

https://aws.amazon.com/jp/about-aws/whats-new/2026/10/aws-lambda-web-functions/

https://aws.amazon.com/blogs/aws/announcing-aws-lambda-web-functions-for-fast-consistent-web-app-performance-anywhere/

The mechanism that had been added to the SDK and CLI on October 1 was officially released this time. The content that was added in advance is explained in the following article.

https://dev.classmethod.jp/articles/aws-lambda-web-functions-source-analysis/

This time, I deployed Lambda Web Functions to the Tokyo region (ap-northeast-1) and tried it out.

What are Lambda Web Functions

Lambda Web Functions is a new type of Lambda function where the application code directly receives and processes HTTP requests. It allows you to run frameworks like Express and Hono without using a conversion adapter such as AWS Lambda Web Adapter. The supported runtime is Node.js 24 (nodejs24.x). The available regions are US East (N. Virginia, Ohio), US West (Oregon), Asia Pacific (Tokyo), and Europe (Ireland) — five regions in total.

Billing applies to the number of requests, active CPU time, memory while the execution environment is running, and standard data transfer. Pricing is calculated in 1 ms increments. CPU time is not billed while waiting for responses from databases or other services.

The request price is $0.30 per 1 million requests for both Tokyo and N. Virginia. The unit prices for vCPU and memory are as follows.

Item Asia Pacific (Tokyo) US East (N. Virginia)
Active vCPU $0.0000322421 / vCPU-second $0.0000276944 / vCPU-second
Memory $0.0000042688 / GB-second $0.0000036667 / GB-second

https://aws.amazon.com/lambda/pricing/

Comparison with Traditional Lambda

Comparing with traditional Lambda (Event Functions, Arm) using N. Virginia pricing:

Item Web Functions Traditional Lambda (Event Functions)
Requests $0.30 / 1M $0.20 / 1M
Memory $0.0000036667 / GB-second $0.0000133334 / GB-second
CPU $0.0000276944 / vCPU-second (active time only) Included in memory pricing

Deploying the --hello-world Sample App

Adding --hello-world to the deploy command completes everything from sample app generation to deployment in a single command.

aws lambda-web deploy --name ga-hello --hello-world --create --region ap-northeast-1
Creating starter application in ./ga-hello ...
Creating deployment package ...
Preparing Amazon S3 bucket ...
Preparing AWS IAM execution role ...
Uploading deployment package ...
Creating Lambda Web Function ...
https://xxxxxxxxxxxxxxxx.xxx.lambda-web.ap-northeast-1.on.aws

The execution took about 26 seconds. I accessed the displayed URL with curl.

curl -sS -i https://xxxxxxxxxxxxxxxx.xxx.lambda-web.ap-northeast-1.on.aws/
HTTP/1.1 200 OK
Content-Type: application/json
lambda-web-logstream: 2026/10/12/ga-hello[rev-xxxxx]xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
lambda-web-request-id: XXXXXXXXXXXXXXXXXXXXXXXXXX

{"message":"Hello from Lambda Web!","path":"/"}

The generated server.ts is as follows.

// Minimal AWS Lambda Web Function HTTP server.
//
// You can replace this with any code or framework that starts an HTTP server.
import http from 'node:http';

// Lambda sends requests to port 3000. Set LOCAL_PORT for local development.
const port = Number(process.env.LOCAL_PORT ?? 3000);

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'content-type': 'application/json' });
  res.end(JSON.stringify({ message: 'Hello from Lambda Web!', path: req.url }));
});

server.listen(port, () => {
  console.log(`listening on port ${port}`);
});

Deploying an Express App

When deploying your own code, specify the directory with --code instead of --hello-world. Since deploy does not resolve dependencies, prepare node_modules in advance.

npm install express@5.3.0

The application code and package.json are as follows.

index.js and package.json
const express = require('express');
const app = express();
const [host, port] = (process.env.AWS_LAMBDA_HTTP_ENDPOINT || 'localhost:3000').split(':');

const startedAt = Date.now();

// Environment information
app.get('/', (request, response) => {
  response.json({
    pid: process.pid,
    node: process.version,
    region: process.env.AWS_REGION,
    httpEndpoint: process.env.AWS_LAMBDA_HTTP_ENDPOINT,
    uptimeMs: Date.now() - startedAt,
    requestId: request.get('lambda-web-request-id')
  });
});

// Official sample SSE (every 1 second)
app.get('/events', (request, response) => {
  response.setHeader('Content-Type', 'text/event-stream');
  response.setHeader('Cache-Control', 'no-cache');
  response.flushHeaders();

  const interval = setInterval(() => {
    response.write(`data: ${JSON.stringify({ time: Date.now() })}\n\n`);
  }, 1000);

  response.on('close', () => {
    clearInterval(interval);
  });
});

app.listen(Number(port), host, () => {
  console.log(`listening on ${host}:${port}`);
});
{
  "name": "ga-express",
  "version": "1.0.0",
  "private": true,
  "main": "index.js",
  "dependencies": {
    "express": "5.3.0"
  }
}

In the directory with node_modules prepared, I ran the following command.

aws lambda-web deploy --name ga-express --code . --create --region ap-northeast-1
Creating deployment package ...
Preparing Amazon S3 bucket ...
Preparing AWS IAM execution role ...
Uploading deployment package ...
Creating Lambda Web Function ...
https://xxxxxxxxxxxxxxxx.xxx.lambda-web.ap-northeast-1.on.aws

The public URL was displayed in about 24 seconds. Accessing / of this URL with curl, Express responded.

curl -sS -i https://xxxxxxxxxxxxxxxx.xxx.lambda-web.ap-northeast-1.on.aws/
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Powered-By: Express

{"pid":2,"node":"v24.21.0","region":"ap-northeast-1","httpEndpoint":"0.0.0.0:3000","uptimeMs":31,"requestId":"XXXXXXXXXXXXXXXXXXXXXXXXXX"}

Streaming Responses with SSE

I connected to /events, which returns SSE, with curl for 6 seconds.

timeout 6 curl -sS -N -i <URL>/events

The response Content-Type was text/event-stream, and 5 events sent by the app every second were delivered to curl. The reception interval was 993–1002 ms.

Summary

With the now-GA Lambda Web Functions, you can run an HTTP server on Lambda without using AWS Lambda Web Adapter or similar tools.

Compared to traditional Lambda, a single execution environment can handle many requests, which is expected to improve execution environment utilization efficiency. Also, while the per-request price increases, billing is based on active CPU time, so there is potential to reduce costs for workloads that tend to have long wait times for external APIs.

On the other hand, memory is billed for the entire time the execution environment is running. For workloads with low access frequency where cold starts are not a concern, traditional Lambda may offer better cost-effectiveness in some cases.

Lambda Web Functions with the Node.js runtime is available in the Tokyo region as well. Please give it a try as one of the new options for web applications.

Share this article

AWSのお困り事はクラスメソッドへ