| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-03-19 | 16.4 kB | |
| v2.32.0 source code.tar.gz | 2026-03-19 | 2.6 MB | |
| v2.32.0 source code.zip | 2026-03-19 | 3.3 MB | |
| Totals: 3 Items | 5.8 MB | 0 | |
Summary
In this release, we are pleased to announce a new utility for interacting with the Lambda Metadata Service in the commons package, allowing you to easily retrieve information about the Lambda function, such as the Availability Zone ID.
In the HTTP event handler, we have delivered two much requested features: a type-safe Store API, letting you share state between middleware and route handlers with full type safety, and request and response validation, so you can enforce data contracts at your API boundary, eliminating manual parsing and type assertion code.
We've also fixed a bug where the Kafka consumer would throw when processing tombstone events with undefined values.
⭐ Congratulations to @haslers for their first PR merged in the project 🎉
Lambda Metadata Service
A new getMetadata() utility in the commons package fetches metadata from the AWS Lambda Metadata endpoint. The utility automatically returns an empty object outside of Lambda, so your code works seamlessly in local development and testing.
:::typescript
import { getMetadata } from '@aws-lambda-powertools/commons/utils/metadata';
import { Logger } from '@aws-lambda-powertools/logger';
const logger = new Logger({ serviceName: 'serverlessAirline' });
const metadata = await getMetadata();
export const handler = async () => {
const { AvailabilityZoneID: azId } = metadata;
logger.appendKeys({ azId });
};
Type-safe Store API
The HTTP event handler now includes a Store API that provides type-safe, scoped state management for route handlers with two built-in storage scopes:
- Request store — per-invocation state (set in middleware, read in handlers). Cleared automatically between requests.
-
Shared store — router-scoped state (set at cold start, read everywhere). Persists across invocations.
:::typescript import { Router } from '@aws-lambda-powertools/event-handler/http'; import type { Context } from 'aws-lambda';
type AppEnv = { store: { request: { userId: string; isAdmin: boolean }; shared: { db: { query: (sql: string) => Promise<unknown> } }; }; };
const app = new Router<AppEnv>();
app.shared.set('db', createDbClient());
app.use(async ({ reqCtx, next }) => { const auth = reqCtx.req.headers.get('Authorization') ?? ''; const { sub, isAdmin } = jwt.verify(auth.replace('Bearer ', ''), 'secret'); reqCtx.set('userId', sub); reqCtx.set('isAdmin', isAdmin); await next(); });
app.get('/profile', async (reqCtx) => { const userId = reqCtx.get('userId'); // typed as string const db = reqCtx.shared.get('db'); // typed as { query: ... } if (!userId || !db) return { error: 'not ready' }; return { userId }; });
export const handler = async (event: unknown, context: Context) => app.resolve(event, context);
Validation Middleware
The new validation feature validates validates request and response data against Standard Schema v1 schemas — a vendor-neutral interface supported by Zod, Valibot, ArkType, and other popular libraries.
You can validate any combination of request body, headers, path parameters, and query parameters. Request validation errors return a structured 422 Unprocessable Entity response, and response validation errors return 500 Internal Server Error. TypeScript infers the handler's context type from your schema config — only validated fields are accessible, catching mismatches at compile time.
:::typescript
import { Router } from '@aws-lambda-powertools/event-handler/http';
import type { Context } from 'aws-lambda';
import { z } from 'zod';
const app = new Router();
const createTodoSchema = z.object({ title: z.string() });
const todoResponseSchema = z.object({
id: z.string(),
title: z.string(),
completed: z.boolean(),
});
app.post(
'/todos',
(reqCtx) => {
const { title } = reqCtx.valid.req.body; // fully typed
return { id: '123', title, completed: false };
},
{
validation: {
req: { body: createTodoSchema },
res: { body: todoResponseSchema }, // runtime check on the response
},
}
);
export const handler = async (event: unknown, context: Context) =>
app.resolve(event, context);
Changes
- fix(commons): rename AvailabilityZoneId to AvailabilityZoneID in docs and tests (#5118) by @svozza
- chore(ci): temporarily disable me-central-1 deployments (#5111) by @svozza
- feat(commons): add Lambda Metadata Service support (#5109) by @svozza
- revert: feat(commons): add Lambda Metadata Service support (#5106) (#5107) by @svozza
- feat(commons): add Lambda Metadata Service support (#5106) by @svozza
- feat(event-handler): add type-safe Store API for request and shared state (#5081) by @svozza
- chore(deps): regenerate package-lock.json to clear stale Dependabot alerts (#5075) by @dreamorosi
- fix(event-handler): add overloads to route() for typed validation context (#5052) by @svozza
- chore: run linting on packages, run npm audit fix manually, address SonarCloud (#5046) by @dreamorosi
- fix(event-handler): default error handler returns a web Response correctly (#5024) by @nateiler
- fix(kafka): handle tombstone events without value (#5017) by @haslers
- ci: use ts extension in layer CDK stack imports (#5010) by @svozza
- ci: fix layer import in CDK stack (#5009) by @dreamorosi
📜 Documentation updates
- feat(event-handler): add validation support for REST router (#4736) by @sdangol
🔧 Maintenance
- chore(deps-dev): bump @biomejs/biome from 2.4.7 to 2.4.8 (#5115) by @dependabot[bot]
- chore(deps): bump valibot from 1.3.0 to 1.3.1 (#5116) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 7.1.0 to 7.1.1 (#5114) by @dependabot[bot]
- chore(deps): bump valibot from 1.2.0 to 1.3.0 (#5101) by @dependabot[bot]
- chore(deps-dev): bump @biomejs/biome from 2.4.6 to 2.4.7 (#5097) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 7.0.0 to 7.1.0 (#5104) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.4.0 to 7.0.0 (#5095) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#5099) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 102 updates (#5098) by @dependabot[bot]
- chore(deps-dev): bump lint-staged from 16.3.3 to 16.4.0 (#5096) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.6 to 4.33.0 (#5094) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 5.0.1 to 5.0.2 (#5093) by @dependabot[bot]
- chore(deps-dev): bump the vitest group across 1 directory with 2 updates (#5088) by @dependabot[bot]
- chore(deps): bump @types/node from 25.4.0 to 25.5.0 (#5091) by @dependabot[bot]
- chore(deps): bump @aws/lambda-invoke-store from 0.2.3 to 0.2.4 (#5089) by @dependabot[bot]
- chore(deps): bump esbuild from 0.27.3 to 0.27.4 (#5090) by @dependabot[bot]
- chore(deps): bump actions/download-artifact from 8.0.0 to 8.0.1 (#5087) by @dependabot[bot]
- chore(deps-dev): bump @aws/durable-execution-sdk-js from 1.0.2 to 1.1.0 (#5085) by @dependabot[bot]
- chore(deps): bump mkdocs-material from 9.7.4 to 9.7.5 in /docs (#5084) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
f4332a8toc373999in /docs (#5083) by @dependabot[bot] - chore(deps-dev): bump lint-staged from 16.3.2 to 16.3.3 (#5080) by @dependabot[bot]
- chore(deps): bump @types/node from 25.3.5 to 25.4.0 (#5079) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#5078) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.3.0 to 6.4.0 (#5076) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 115 updates (#5077) by @dependabot[bot]
- chore(deps): bump @types/node from 25.3.3 to 25.3.5 (#5071) by @dependabot[bot]
- chore(deps-dev): bump @biomejs/biome from 2.4.5 to 2.4.6 (#5070) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.2.0 to 6.3.0 (#5069) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.5 to 4.32.6 (#5068) by @dependabot[bot]
- chore(deps): bump markdown from 3.7 to 3.8.1 in /docs (#5067) by @dependabot[bot]
- chore(deps): bump arktype from 2.1.29 to 2.2.0 (#5066) by @dependabot[bot]
- chore(deps-dev): bump lint-staged from 16.3.1 to 16.3.2 (#5065) by @dependabot[bot]
- chore(deps): bump mkdocs-material from 9.7.3 to 9.7.4 in /docs (#5064) by @dependabot[bot]
- chore(deps): bump actions/setup-node from 6.2.0 to 6.3.0 (#5063) by @dependabot[bot]
- chore(deps): bump actions/dependency-review-action from 4.8.3 to 4.9.0 (#5062) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
8f41b60tof4332a8in /docs (#5061) by @dependabot[bot] - chore(deps-dev): bump @biomejs/biome from 2.4.4 to 2.4.5 (#5060) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#5059) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 65 updates (#5057) by @dependabot[bot]
- chore(deps): bump @types/node from 25.3.2 to 25.3.3 (#5056) by @dependabot[bot]
- chore(deps-dev): bump lint-staged from 16.2.7 to 16.3.1 (#5055) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.4 to 4.32.5 (#5054) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 5.0.0 to 5.0.1 (#5053) by @dependabot[bot]
- chore(deps): bump @types/aws-lambda from 8.10.160 to 8.10.161 (#5050) by @dependabot[bot]
- chore(deps): bump @types/node from 25.3.1 to 25.3.2 (#5049) by @dependabot[bot]
- chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 (#5048) by @dependabot[bot]
- chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 (#5047) by @dependabot[bot]
- chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 (#5042) by @dependabot[bot]
- chore(deps): bump @types/node from 25.3.0 to 25.3.1 (#5043) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.3 to 4.32.4 (#5035) by @dependabot[bot]
- chore(deps): bump actions/dependency-review-action from 4.8.2 to 4.8.3 (#5033) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
1c30983to8f41b60in /docs (#5039) by @dependabot[bot] - chore(deps-dev): bump @biomejs/biome from 2.4.2 to 2.4.4 (#5036) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 113 updates (#5041) by @dependabot[bot]
- chore(deps): bump mkdocs-material from 9.7.2 to 9.7.3 in /docs (#5040) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#5038) by @dependabot[bot]
- feat(event-handler): add validation support for REST router (#4736) by @sdangol
- chore(deps): bump squidfunk/mkdocs-material from
3bba0a9to1c30983in /docs (#5029) by @dependabot[bot] - chore(deps): bump mkdocs-material from 9.7.1 to 9.7.2 in /docs (#5030) by @dependabot[bot]
- chore(deps): bump constructs from 10.5.0 to 10.5.1 (#5031) by @dependabot[bot]
- chore(deps): bump @types/node from 25.2.3 to 25.3.0 (#5032) by @dependabot[bot]
- chore(deps): bump actions/stale from 10.1.1 to 10.2.0 (#5025) by @dependabot[bot]
- chore(deps-dev): bump @biomejs/biome from 2.4.0 to 2.4.2 (#5026) by @dependabot[bot]
- chore(deps-dev): bump @redis/client from 5.10.0 to 5.11.0 (#5027) by @dependabot[bot]
- chore(deps): bump constructs from 10.4.5 to 10.5.0 (#5028) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#5023) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 58 updates (#5022) by @dependabot[bot]
- chore(deps): bump ajv from 8.17.1 to 8.18.0 (#5021) by @dependabot[bot]
- chore(deps-dev): bump @biomejs/biome from 2.3.15 to 2.4.0 (#5020) by @dependabot[bot]
- chore(deps-dev): bump typedoc from 0.28.16 to 0.28.17 in the typescript group across 1 directory (#5018) by @dependabot[bot]
- chore(deps-dev): bump markdownlint-cli2 from 0.20.0 to 0.21.0 (#5019) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.2 to 4.32.3 (#5015) by @dependabot[bot]
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 50 updates (#5005) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 4.0.1 to 5.0.0 (#5003) by @dependabot[bot]
- chore(deps-dev): bump @biomejs/biome from 2.3.14 to 2.3.15 (#5014) by @dependabot[bot]
- chore(deps): bump @types/node from 25.2.2 to 25.2.3 (#5012) by @dependabot[bot]
- chore(deps-dev): bump @valkey/valkey-glide from 2.2.6 to 2.2.7 (#5006) by @dependabot[bot]
This release was made possible by the following contributors:
@dependabot[bot], @dreamorosi, @github-actions[bot], @haslers, @nateiler, @sdangol, @svozza, @willfarrell, dependabot[bot] and github-actions[bot]