Skip to content

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Sep 29, 2025

Bumps @aws-lambda-powertools/tracer from 1.18.1 to 2.27.0.

Release notes

Sourced from @​aws-lambda-powertools/tracer's releases.

v2.27.0

Summary

We're excited to announce an update to our Event Handler utility, featuring new middleware for CORS (Cross-Origin Resource Sharing) configuration and automatic response compression. We have also added support for Route Prefixes which allows you to avoid repeating a shared prefix in each route definition.

We've listened to your feedback and also made some slight changes to the type signature in the handlers to improve developer experience.

We have also made the error handlers more versatile by allowing a Response object or a JavaScript object to be returned from the error handler.

⭐ Congratulations @​guillemcomerma for their first PR merged in the project, and thank you to @​shrivarshapoojari and @​dani-abib for their contributions 🎉

CORS Middleware

Docs

The CORS middleware ensures CORS headers are returned as part of the response when your functions match the path invoked and the Origin matches one of the allowed values.

import { Router } from '@aws-lambda-powertools/event-handler/experimental-rest';
import { cors } from '@aws-lambda-powertools/event-handler/experimental-rest/middleware';
import type { Context } from 'aws-lambda';
const app = new Router();
app.use(
cors({
origin: 'https://example.com',
maxAge: 300,
})
);
app.get('/todos/:todoId', async ({ params: { todoId } }) => {
const todo = await getTodoById(todoId);
return { todo };
});
export const handler = async (event: unknown, context: Context) =>
app.resolve(event, context);
/**
When invoked from a valid origin, this returns:
{
"statusCode": 200,
"headers": {
"access-control-allow-credentials": "false",
"access-control-allow-origin": "https://example.com",
"content-type": "application/json"
},
"multiValueHeaders": {
</tr></table>

... (truncated)

Changelog

Sourced from @​aws-lambda-powertools/tracer's changelog.

2.27.0 (2025-09-24)

Bug Fixes

  • batch fixed the build issue with Batch processor due to missing dependencies (#4498) (ef67b43)
  • event-handler fixed CORS behaviour not aligned with CORS spec (#4512) (dd368fa)
  • event-handler run global middleware on all requests for REST API (#4507) (49d5f8a)

Improvements

  • event-handler rename HttpErrorCodes to HttpStatusCodes (#4543) (e53aa88)
  • event-handler made error handler responses versatile (#4536) (f08b366)
  • event-handler changed path parameter in middleware and routehandler signature (#4532) (278fca0)
  • event-handler change the Middleware and RequestContext signatures (#4530) (a05c074)

Features

  • event-handler implemented route prefixes in HTTP event handler (#4523) (8913854)
  • event-handler throw error when middleware does not await next() (#4511) (b0b43e8)
  • event-handler add CORS middleware support (#4477) (972cd1f)
  • event-handler added compress middleware for the REST API event handler (#4495) (320e0dc)

2.26.1 (2025-09-15)

Bug Fixes

  • batch declare the @​aws-lambda-powertools/commons dependency (#4484) (8cfcccd)

2.26.0 (2025-09-11)

Improvements

  • logger update getCodeLocation regex to improve performance (#4389) (801333d)
  • batch simplified the parser integration api with batch processor (#4465) (96977ff)

Bug Fixes

  • parser updated the binaryValue and stringValue in the SqsMsgAttributeSchema to nullable (#4450) (cefcbdb)
  • event-handler handle nullable fields in APIGatewayProxyEvent (#4455) (200f47b)

Features

  • parser integrate parser with Batch Processing (#4408) (0b6bbbb)
  • parser implemented a helper function Base64Encoded to decode base64 encoded payloads (#4413) (1554360)
  • parser add IPv6 support for sourceIp in API Gateway schemas (#4398) (2a94c37)
  • event-handler remove undefined from Router's resolve type signature (#4463) (d36ef55)
  • event-handler implement mechanism to manipulate response in middleware (#4439) (35a510d)
  • event-handler add route specific middleware registration and execution (#4437) (e6ea674)

... (truncated)

Upgrade guide

Sourced from @​aws-lambda-powertools/tracer's upgrade guide.


title: Upgrade guide description: Guide to update between major Powertools for AWS Lambda (TypeScript) versions

End of support v1

!!! warning "On March 13th, 2024, Powertools for AWS Lambda (TypeScript) v1 entered maintenance mode, and has reached End-of-Life on September 1st, 2024. If you are still using v1, we strongly recommend you to upgrade to the latest version."

Given our commitment to all of our customers using Powertools for AWS Lambda (TypeScript), we will keep npm v1 releases and documentation 1.x versions to prevent any disruption.

Migrate from v1 to v2

V2 is focused on official support for ESM (ECMAScript modules). We've made other minimal breaking changes to make your transition to v2 as smooth as possible.

Quick summary

Area Change Code change required
ESM support Added ESM support via dual CommonJS and ESM bundling, enabling top-level await and tree-shaking. -
Middy.js Updated import path for Middy.js middlewares to leverage subpath exports - i.e. @aws-lambda-powertools/tracer/middleware. Yes
Types imports Updated import path for TypeScript types to leverage subpath exports - i.e. @aws-lambda-powertools/logger/types. Yes
Logger Changed log sampling to dynamically switch log level to DEBUG on a percentage of requests. -
Logger Updated custom log formatter to include standard as well as persistent keys. Yes
Logger Removed ContextExamples from @aws-lambda-powertools/commons package. Yes
Logger and Tracer Removed deprecated createLogger and createTracer helper functions in favor of direct instantiation. Yes

First steps

Before you start, we suggest making a copy of your current working project or create a new git branch.

  1. Upgrade Node.js to v18 or higher, Node.js v20 is recommended.
  2. Ensure that you have the latest Powertools for AWS Lambda (TypeScript) version via Lambda Layer or npm.
  3. Review the following sections to confirm whether they apply to your codebase.

ESM support

With support for ES Modules in v2, you can now use import instead of require syntax.

This is especially useful when you want to run asynchronous code during the initialization phase by using top-level await.

import { getSecret } from '@aws-lambda-powertools/parameters/secrets';
// This code will run during the initialization phase of your Lambda function
const myApiKey = await getSecret('my-api-key', { transform: 'json' });
export const handler = async (_event: unknown, _context: unknown) => {
</tr></table>

... (truncated)

Commits
  • f38af1d chore(ci): bump version to 2.27.0 (#4544)
  • 72cf1cd docs(event-handler): update to new APIs before release (#4542)
  • e53aa88 improv(event-handler): rename HttpErrorCodes to HttpStatusCodes (#4543)
  • 3d1255c docs(idempotency): fix dataKeywordArgument reference and remove unused test c...
  • f08b366 improv(event-handler): made error handler responses versatile (#4536)
  • fd156aa chore(ci): add registry-url to setup-node steps to fix Scorecard packagin...
  • d281d46 chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#4527)
  • 278fca0 improv(event-handler): changed path parameter in middleware and routehandler ...
  • 7ea49c7 chore(deps): bump the aws-sdk-v3 group across 1 directory with 62 updates (#4...
  • a05c074 improv(event-handler): change the Middleware and RequestContext signatures (#...
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by aws-powertools-bot, a new releaser for @​aws-lambda-powertools/tracer since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [@aws-lambda-powertools/tracer](https://github.com/aws-powertools/powertools-lambda-typescript) from 1.18.1 to 2.27.0.
- [Release notes](https://github.com/aws-powertools/powertools-lambda-typescript/releases)
- [Changelog](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/CHANGELOG.md)
- [Upgrade guide](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/docs/upgrade.md)
- [Commits](aws-powertools/powertools-lambda-typescript@v1.18.1...v2.27.0)

---
updated-dependencies:
- dependency-name: "@aws-lambda-powertools/tracer"
  dependency-version: 2.27.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants