
AWS Lambda の Node.js 26 ランタイムを Event Functions と Web Functions で試してみた
はじめに
2026年11月20日、AWS Lambda が Node.js 26 ランタイムをサポートしたことが発表されました。
Node.js 26 は LTS リリースです。Lambda では2026年8月にプレビュー提供が始まっていました。
本記事では、Event Functions と Web Functions で Node.js 26 ランタイムを試した結果を紹介します。
検証環境
- リージョン:東京(ap-northeast-1)
- AWS CLI:2.42.1
- ランタイム識別子:nodejs26.x
Event Functions
実行環境の Node.js のバージョンと、Temporal API を使えるかどうかを確かめます。Temporal は、Date オブジェクトでは扱いにくいタイムゾーンや暦を含めて、日付と時刻を扱うための JavaScript の API です。
zip アーカイブ
確認用コード index.mjs(後述)を event-zip.zip にまとめ、ランタイムに nodejs26.x を指定して関数を作成します。State が Active になるまで待ちます。
aws lambda create-function \
--function-name <function-name> \
--runtime nodejs26.x \
--handler index.handler \
--role arn:aws:iam::<ACCOUNT_ID>:role/<execution-role-name> \
--zip-file fileb://event-zip.zip
aws lambda wait function-active-v2 --function-name <function-name>
呼び出して、応答を response.json に保存します。
aws lambda invoke \
--function-name <function-name> \
--cli-binary-format raw-in-base64-out \
--payload '{}' \
response.json
response.json の内容は次のとおりです。nodeOptions と execArgv は省略し、後述の「Node.js 24 との比較」で示します。
{
"processVersion": "v26.13.1",
"versions": {
"node": "26.13.1",
"v8": "14.6.202.34-node.40",
"undici": "8.12.4"
},
"executionEnv": "AWS_Lambda_nodejs26.x",
"typeofTemporal": "object",
"temporal": {
"nowInTokyo": "2026-11-22T00:25:04.005378906+09:00[Asia/Tokyo]",
"plus30Days": "2026-12-20"
}
}
確認用コードは、Temporal を import せず、グローバルオブジェクトの Temporal を参照しています。
CloudWatch Logs の INIT_START 行には、次のようにランタイムのバージョンが出力されました。
INIT_START Runtime Version: nodejs:26.mainline.v91
確認用コード(index.mjs)
export const handler = async () => {
const v = process.versions;
const hasTemporal = typeof Temporal !== "undefined";
return {
processVersion: process.version,
versions: { node: v.node, v8: v.v8, undici: v.undici },
executionEnv: process.env.AWS_EXECUTION_ENV,
nodeOptions: process.env.NODE_OPTIONS ?? null,
execArgv: process.execArgv,
typeofTemporal: typeof Temporal,
temporal: hasTemporal
? {
nowInTokyo: Temporal.Now.zonedDateTimeISO("Asia/Tokyo").toString(),
plus30Days: Temporal.PlainDate.from("2026-11-20")
.add({ days: 30 })
.toString(),
}
: null,
};
};
Node.js 24 との比較
zip アーカイブで作成した関数のランタイムを nodejs24.x に切り替え、コードは変えずに呼び出して、Node.js 26 の結果と比べました。
aws lambda update-function-configuration \
--function-name <function-name> \
--runtime nodejs24.x
aws lambda wait function-updated-v2 --function-name <function-name>
| 項目 | nodejs24.x | nodejs26.x |
|---|---|---|
| process.version | v24.22.3 | v26.13.1 |
| V8 | 13.6.233.17-node.63 | 14.6.202.34-node.40 |
| Undici | 7.30.2 | 8.12.4 |
| typeof Temporal | undefined | object |
| NODE_OPTIONS | 未設定 | --tls-cipher-list=... が設定済み |
どちらのランタイムでも、関数の環境変数は設定していません。Node.js 26 では NODE_OPTIONS に、TLS の暗号スイートを指定する --tls-cipher-list が設定されていました。
Node.js の起動オプションを表す execArgv は、nodejs24.x では次のとおりでした。
["--expose-gc","--max-http-header-size","81920","--no-experimental-detect-module","--no-experimental-require-module","--max-semi-space-size=2","--max-old-space-size=116"]
nodejs26.x では次のとおりでした。
["--expose-gc","--max-http-header-size","81920","--no-experimental-detect-module","--no-experimental-require-module","--no-experimental-ffi","--max-semi-space-size=2","--max-old-space-size=116"]
差は --no-experimental-ffi だけでした。
Web Functions
Node.js 26 を指定した Web Function をデプロイし、Event Functions と同じ項目を HTTP で取得します。
デプロイ
web ディレクトリに確認用コード index.js(後述)を置き、aws lambda-web deploy でデプロイします。
aws lambda-web deploy \
--name <function-name> \
--code web \
--runtime nodejs26.x \
--entry-point index.js \
--create
デプロイコマンドの出力に表示される on.aws ドメインのエンドポイント URL へ、curl でアクセスします。
curl -sS <endpoint-url>
確認用コード(index.js)
const http = require("node:http");
const [host, port] = (process.env.AWS_LAMBDA_HTTP_ENDPOINT || "localhost:3000").split(":");
const server = http.createServer((req, res) => {
const v = process.versions;
const body = {
processVersion: process.version,
versions: { node: v.node, v8: v.v8, undici: v.undici },
executionEnv: process.env.AWS_EXECUTION_ENV ?? null,
nodeOptions: process.env.NODE_OPTIONS ?? null,
execArgv: process.execArgv,
typeofTemporal: typeof Temporal,
temporal:
typeof Temporal !== "undefined"
? {
nowInTokyo: Temporal.Now.zonedDateTimeISO("Asia/Tokyo").toString(),
plus30Days: Temporal.PlainDate.from("2026-11-20").add({ days: 30 }).toString(),
}
: null,
};
res.writeHead(200, { "content-type": "application/json" });
res.end(JSON.stringify(body));
});
server.listen(Number(port), host);
実行結果
レスポンスは次のとおりです。nodeOptions と execArgv は省略しています。
{
"processVersion": "v26.13.1",
"versions": {
"node": "26.13.1",
"v8": "14.6.202.34-node.40",
"undici": "8.12.4"
},
"executionEnv": "AWS_Lambda_nodejs26.x-lambda-web",
"typeofTemporal": "undefined",
"temporal": null
}
Node.js、V8、Undici のバージョンは Event Functions と同じでしたが、typeof Temporal は undefined でした。Node.js 26.0.0 のリリースノートでは、Temporal は既定で有効とされています。確認したのは、上のコマンドでデプロイした、node:http で応答する CommonJS の Web Function 1つです。
Powertools と CloudFormation
Powertools for AWS Lambda (TypeScript)
Powertools の Logger を Node.js 26 の関数で使います。package.json の依存には latest を指定し、2.36.0 がインストールされました。
{
"name": "n26v-powertools",
"version": "1.0.0",
"private": true,
"type": "module",
"dependencies": {
"@aws-lambda-powertools/logger": "latest"
}
}
import { Logger } from "@aws-lambda-powertools/logger";
const logger = new Logger({ serviceName: "n26v-powertools" });
export const handler = async () => {
logger.info("hello from Node.js 26", {
nodeVersion: process.version,
typeofTemporal: typeof Temporal,
});
return { nodeVersion: process.version };
};
依存パッケージのインストールは、Node.js 26.13.1 の公式コンテナイメージ(node:26)の中で実行しました。
npm install --omit=dev
node_modules を含めて zip にまとめ、「zip アーカイブ」の節と同じ手順で nodejs26.x の関数を作成して呼び出しました。CloudWatch Logs には次の構造化ログが出力されました。xray_trace_id の値は省略しています。
{"level":"INFO","message":"hello from Node.js 26","timestamp":"2026-11-21T15:29:20.354Z","service":"n26v-powertools","sampling_rate":0,"xray_trace_id":"...","nodeVersion":"v26.13.1","typeofTemporal":"object"}
CloudFormation
AWS::Lambda::Function の Runtime に nodejs26.x を指定したテンプレートを、cfn-template.yaml として保存します。
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
RoleArn:
Type: String
Resources:
Function:
Type: AWS::Lambda::Function
Properties:
FunctionName: n26v-cfn
Runtime: nodejs26.x
Handler: index.handler
Role: !Ref RoleArn
Code:
ZipFile: |
exports.handler = async () => ({
nodeVersion: process.version,
typeofTemporal: typeof Temporal,
});
Outputs:
FunctionName:
Value: !Ref Function
スタックを作成し、完了を待ちます。
aws cloudformation create-stack \
--stack-name <stack-name> \
--template-body file://cfn-template.yaml \
--parameters ParameterKey=RoleArn,ParameterValue=<role-arn>
aws cloudformation wait stack-create-complete --stack-name <stack-name>
スタックのステータスは CREATE_COMPLETE になり、作成された関数の Runtime は nodejs26.x、State は Active でした。この関数を呼び出した応答は次のとおりです。
{"nodeVersion":"v26.13.1","typeofTemporal":"object"}
まとめ
Event Functions と Web Functions で、Node.js 26.13.1 の動作を確認できました。
Node.js 26 は LTS リリースで、2029年4月までのサポートが予定されています。
サポート期間の残りが少ない Node.js バージョンを使っている場合は、Node.js 26 への更新に向けた評価をおすすめします。新規に Lambda 関数を作る際に長いサポート期間を確保したい場合や、Event Functions で Temporal API を使いたい場合も、Node.js 26 が候補になります。







