Releases: aws-powertools/powertools-lambda-typescript
v2.11.0
Summary
In this release we’ve added support for the new Node.js 22 managed runtime in AWS Lambda 🚀.
We have also added two new features to Metrics to let you: 1/ set a custom logger, and 2/ emit metrics with a custom timestamp; and improved Batch Processing by adding async processing of SQS FIFO queues.
⭐️ Thanks to @arnabrahman and @psperber for their contributions to this release!
Node.js 22 support
You can now use Powertools for AWS Lambda (TypeScript) with the new Node.js 22 runtime in AWS Lambda.
We’ve partnered with the AWS Lambda team for this launch and have been testing our toolkit for the past few weeks to ensure compatibility with no changes from your side.
To start using Powertools for AWS with the new runtime, you can upgrade to this version via npm or use the latest version of our Lambda layer.
Custom timestamps in metrics
You can now configure the timestamp of all the metrics you create, using the setTimestamp()
method. This allows you to specify a Datetime object or an integer representing an epoch timestamp in milliseconds. This is useful when emitting metrics related to an event in the past or in the future.
Bring your own logger to Metrics
Additionally, you can now also set a custom logger that the Metrics utility will use to emit warnings and debug logs. This is helpful for when you want to silence certain warnings or see diagnostic messages from the utility. To avoid compatibility issues and potential data loss, we will continue to emit the EMF blobs for your metrics directly to stdout.
FIFO queues async processing
You can now use an asynchronous function as record handler when processing a batch of items coming from an Amazon SQS FIFO queue. This is helpful when you need to perform side effects that involve http requests or other AWS services.
Changes
- chore(deps): bump github/codeql-action from 3.27.0 to 3.27.3 (#3314) by @dependabot
- chore(parser): fix type inference for result types (#3293) by @am29d
- chore: fix relative import regression (#3287) by @dreamorosi
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.15 to 3.0.16 (#3282) by @dependabot
- chore(deps): bump actions/setup-node from 4.0.4 to 4.1.0 (#3258) by @dependabot
- chore(deps): bump actions/dependency-review-action from 4.3.5 to 4.4.0 (#3268) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.13 to 3.27.0 (#3245) by @dependabot
- chore(deps): bump actions/checkout from 4.2.1 to 4.2.2 (#3253) by @dependabot
- chore(deps): bump actions/setup-python from 5.2.0 to 5.3.0 (#3259) by @dependabot
- chore(deps): bump actions/dependency-review-action from 4.3.4 to 4.3.5 (#3235) by @dependabot
- chore(maintenance): add force-publish to bump all packages (#3238) by @am29d
🌟New features and non-breaking changes
- feat(batch): Async Processing of Records for for SQS Fifo (#3160) by @arnabrahman
- feat(metrics): add ability to pass custom logger (#3057) by @dreamorosi
🌟 Minor Changes
- improv(parser): export API Gateway v2 request schemas (#3271) by @dreamorosi
📜 Documentation updates
- chore: migrate dev environment to nodejs22 (#3327) by @dreamorosi
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3335) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.44 to 9.5.45 in /docs (#3334) by @dependabot
- feat(metrics): ability to set custom timestamp with
setTimestamp
for metrics (#3310) by @arnabrahman - chore(deps): bump the aws-sdk-v3 group across 1 directory with 3 updates (#3312) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3297) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3300) by @dependabot
- feat(batch): Async Processing of Records for for SQS Fifo (#3160) by @arnabrahman
- chore(deps): bump @types/node from 22.8.4 to 22.9.0 (#3290) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
2c2802b
toce587cb
in /docs (#3294) by @dependabot - chore(deps): bump mkdocs-material from 9.5.43 to 9.5.44 in /docs (#3295) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3280) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3277) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
31eb7f7
to2c2802b
in /docs (#3276) by @dependabot - chore(deps): bump mkdocs-material from 9.5.41 to 9.5.43 in /docs (#3274) by @dependabot
- chore(deps-dev): bump tsx from 4.19.1 to 4.19.2 (#3275) by @dependabot
- chore(deps): bump @types/node from 22.7.7 to 22.8.4 (#3272) by @dependabot
- chore(docs): fix typo in captureHTTPsRequests (#3143) by @psperber
🐛 Bug and hot fixes
- fix(metrics): skip empty string dimension values (#3319) by @arnabrahman
- fix(parser): event type literal for selfManagedKafka (#3325) by @am29d
- fix(parser): add aws region to kinesis event (#3260) by @am29d
- fix(parser): fix cause errors nested structure (#3250) by @am29d
🔧 Maintenance
- chore: migrate dev environment to nodejs22 (#3327) by @dreamorosi
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3335) by @dependabot
- chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 (#3331) by @dependabot
- chore(deps-dev): bump @vitest/coverage-v8 from 2.1.4 to 2.1.5 (#3318) by @dependabot
- fix(parser): event type literal for selfManagedKafka (#3325) by @am29d
- chore(deps): bump aws-xray-sdk-core from 3.10.1 to 3.10.2 (#3313) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 3 updates (#3312) by @dependabot
- test(parameters): migrate tests to vitest (#3304) by @dreamorosi
- chore(deps-dev): bump aws-sdk from 2.1691.0 to 2.1692.0 (#3298) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3297) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3300) by @dependabot
- test(parser): migrate to vitest (#3299) by @dreamorosi
- chore(deps-dev): bump @vitest/coverage-v8 from 2.1.3 to 2.1.4 (#3289) by @dependabot
- chore(deps): bump @types/node from 22.8.4 to 22.9.0 (#3290) by @dependabot
- test(maintenance): switch layers to vitest (#3292) by @dreamorosi
- chore(deps-dev): bump typedoc from 0.26.10 to 0.26.11 in the typedoc group across 1 directory (#3281) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3280) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3277) by @dependabot
- test(maintenance): switch tracer to vitest (#3285) by @dreamorosi
- chore(deps-dev): bump @types/jest from 29.5.13 to 29.5.14 (#3244) by @dependabot
- chore(deps-dev): bump tsx from 4.19.1 to 4.19.2 (#3275) by @dependabot
- chore(deps): bump @types/node from 22.7.7 to 22.8.4 (#3272) by @dependabot
- chore(maintenance): exclude e2e tests from pre-push hook (#3240) by @dreamorosi
This release was made possible by the following contributors:
@am29d, @arnabrahman, @dependabot, @dependabot[bot], @dreamorosi, @github-actions, @github-actions[bot] and @psperber
v2.10.0
Summary
This release improves the Logger utility by extending the formatting of errors to include custom properties.
⭐️ Thanks to @kevinpeno, and @ralbertazzi for their contributions to this release!
Log error properties
you more context over the nature of errors.
For example, consider these two custom error classes:
When calling logger.error('An error occurred', new SuperCustomError('foo', 42)); the log now looks like this:
Changes
- chore(maintenance): add force-publish to bump all packages (#3238) by @am29d
- chore(ci): add input type to the publish package workflow (#3236) by @am29d
- chore(ci): add workflow to publish a single package (#3234) by @am29d
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.14 to 3.0.15 (#3223) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.12 to 3.26.13 (#3202) by @dependabot
- chore(deps): bump actions/upload-artifact from 4.4.2 to 4.4.3 (#3187) by @dependabot
- chore(deps): bump actions/upload-artifact from 4.4.0 to 4.4.2 (#3176) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.11 to 3.26.12 (#3174) by @dependabot
- chore(deps): bump actions/checkout from 4.2.0 to 4.2.1 (#3175) by @dependabot
- chore(layers): remove schema parsing from layer canary (#3171) by @dreamorosi
🌟New features and non-breaking changes
- feat: add resetKeys to LoggerInterface type (#3213) by @ralbertazzi
- feat(logger): include enumerable properties in formatted errors (#3195) by @dreamorosi
📜 Documentation updates
- chore(deps): bump squidfunk/mkdocs-material from
0d4e687
to31eb7f7
in /docs (#3224) by @dependabot - chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3220) by @dependabot
- chore(deps): bump @types/node from 22.7.6 to 22.7.7 (#3221) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 5 updates (#3218) by @dependabot
- chore(deps): bump constructs from 10.3.0 to 10.4.2 (#3205) by @dependabot
- chore(deps): bump @types/node from 22.7.5 to 22.7.6 (#3216) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
f9cb76d
to0d4e687
in /docs (#3211) by @dependabot - chore(deps): bump mkdocs-material from 9.5.40 to 9.5.41 in /docs (#3210) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3203) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3198) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.38 to 9.5.40 in /docs (#3186) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
7aea359
tof9cb76d
in /docs (#3185) by @dependabot - chore(deps): bump typescript from 5.6.2 to 5.6.3 (#3181) by @dependabot
- chore(deps): bump @types/node from 22.7.4 to 22.7.5 (#3180) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3192) by @dependabot
- docs(maintenance): add community content (#3190) by @dreamorosi
- docs(metrics): clarify single metrics metadata & publish (#3189) by @dreamorosi
- docs: fix env variable name in
logEventIfEnabled()
docstring (#3197) by @kevinpeno - chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3167) by @dependabot
🔧 Maintenance
- chore(maintenance): exclude e2e tests from pre-push hook (#3240) by @dreamorosi
- chore(parser): bump parser to 2.10.0 (#3230) by @am29d
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3220) by @dependabot
- chore(deps): bump @types/node from 22.7.6 to 22.7.7 (#3221) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
61c3428
tod493ef0
in /.devcontainer (#3214) by @dependabot - chore(deps): bump the aws-sdk-v3 group across 1 directory with 5 updates (#3218) by @dependabot
- chore(deps-dev): bump @biomejs/biome from 1.9.3 to 1.9.4 (#3219) by @dependabot
- chore(deps-dev): bump @vitest/coverage-v8 from 2.1.2 to 2.1.3 (#3206) by @dependabot
- chore(deps): bump constructs from 10.3.0 to 10.4.2 (#3205) by @dependabot
- chore(deps-dev): bump aws-sdk-client-mock-vitest from 4.0.0 to 4.0.1 (#3215) by @dependabot
- chore(deps): bump @types/node from 22.7.5 to 22.7.6 (#3216) by @dependabot
- chore(deps-dev): bump the aws-sdk-v3 group across 1 directory with 2 updates (#3207) by @dependabot
- chore(deps-dev): bump typedoc from 0.26.8 to 0.26.10 in the typedoc group across 1 directory (#3209) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3203) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3198) by @dependabot
- chore(deps): bump typescript from 5.6.2 to 5.6.3 (#3181) by @dependabot
- chore(deps): bump @types/node from 22.7.4 to 22.7.5 (#3180) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3192) by @dependabot
- chore(deps-dev): bump @biomejs/biome from 1.9.0 to 1.9.3 (#3177) by @dependabot
- chore(deps-dev): bump typedoc from 0.26.7 to 0.26.8 in the typedoc group across 1 directory (#3166) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
426f06d
to61c3428
in /.devcontainer (#3141) by @dependabot - chore(deps-dev): bump @vitest/coverage-v8 from 2.1.1 to 2.1.2 (#3152) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3167) by @dependabot
- chore(deps-dev): bump aws-cdk from 1.155.0 to 1.161.0 in layers (#3169) by @dreamorosi
This release was made possible by the following contributors:
@am29d, @dreamorosi, @kevinpeno, and @ralbertazzi
v2.9.0
Summary
This release introduces 1/ the ability to process records sequentially when working with async functions in Batch Processing, 2/ a new option for Idempotency to manipulate the payload stored for idempotent operations, and 3/ the option to specify custom JMESPath functions when selecting an idempotency key.
Finally, you can now use the Parser utility when using our public AWS Lambda layers.
⭐️ Thanks to @arnabrahman, @garysassano and, @scratchclaggy for their big contributions to this release!
Sequential async processing
You can now process records sequentially when working with async functions in Batch Processing by setting the processInParallel
option to false
. This is useful for when you want to opt-out of the default behavior and preserve the order of the records.
Manipulating idempotent responses
Now you can set up a responseHook
function when configuring the Idempotency utility to manipulate the returned data when an operation is idempotent.
Custom JMESPath functions with Idempotency
You can now use custom JMESPath functions with the Idempotency utility by configuring the jmesPathOptions
in your idempotency configuration. This is useful when you’re making idempotent operations that accept complex payloads or encoding formats that are not supported by default.
Changes
- chore(layers): remove schema parsing from layer canary (#3171) by @dreamorosi
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.12 to 3.0.14 (#3162) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.9 to 3.26.11 (#3157) by @dependabot
- chore(deps): bump actions/checkout from 4.1.7 to 4.2.0 (#3122) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.8 to 3.26.9 (#3114) by @dependabot
- chore(deps): bump actions/setup-node from 4.0.3 to 4.0.4 (#3097) by @dependabot
- chore(layers): add Parser to layer (#3101) by @scratchclaggy
- chore(deps): bump github/codeql-action from 3.26.7 to 3.26.8 (#3087) by @dependabot
🌟New features and non-breaking changes
- feat(idempotency): ability to specify JMESPath custom functions (#3150) by @arnabrahman
- feat(batch): sequential async processing of records for
BatchProcessor
(#3109) by @arnabrahman - feat(idempotency): manipulate idempotent response via response hook (#3071) by @arnabrahman
🌟 Minor Changes
- refactor(logger): use
LogLevelThreshold
constant insideLogger
class (#3133) by @arnabrahman
📜 Documentation updates
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3163) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3156) by @dependabot
- chore(maintenance): add Flyweight customer reference (#3161) by @dreamorosi
- docs(parser): highlight
JSONStringify
helper (#3158) by @dreamorosi - feat(idempotency): ability to specify JMESPath custom functions (#3150) by @arnabrahman
- chore(deps): bump @types/node from 22.7.2 to 22.7.4 (#3139) by @dependabot
- feat(batch): sequential async processing of records for
BatchProcessor
(#3109) by @arnabrahman - chore(deps): bump mkdocs-material from 9.5.36 to 9.5.38 in /docs (#3121) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
22a429f
to7aea359
in /docs (#3120) by @dependabot - chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3116) by @dependabot
- chore(docs): recreate requirements.txt file for mkdocs container (#3119) by @leandrodamascena
- chore(deps): bump squidfunk/mkdocs-material from
2a70399
to22a429f
in /docs (#3104) by @dependabot - chore(deps): bump mkdocs-material from 9.5.35 to 9.5.36 in /docs (#3105) by @dependabot
- chore(deps): bump @types/node from 22.5.5 to 22.7.2 (#3115) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3110) by @dependabot
- chore(deps): bump esbuild from 0.23.1 to 0.24.0 (#3102) by @dependabot
- docs(idempotency): fix descriptions in
Advanced
table (#3092) by @garysassano - chore(deps): bump the aws-sdk-v3 group across 1 directory with 6 updates (#3107) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3088) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3090) by @dependabot
- feat(idempotency): manipulate idempotent response via response hook (#3071) by @arnabrahman
- chore(deps): bump squidfunk/mkdocs-material from
a2e3a31
to2a70399
in /docs (#3082) by @dependabot - chore(deps): bump mkdocs-material from 9.5.34 to 9.5.35 in /docs (#3084) by @dependabot
- chore(deps): bump @types/node from 22.5.4 to 22.5.5 (#3067) by @dependabot
🔧 Maintenance
- chore(deps-dev): bump aws-cdk from 1.155.0 to 1.161.0 in layers (#3169) by @dreamorosi
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3163) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3156) by @dependabot
- chore(maintenance): add Flyweight customer reference (#3161) by @dreamorosi
- chore(metrics): expose
MetricsInterface
as return type of single metric and further improve API docs (#3145) by @dreamorosi - test(idempotency): switch e2e tests to vitest (#3149) by @dreamorosi
- test(logger): switch e2e tests to vitest (#3148) by @dreamorosi
- chore(deps): bump @types/node from 22.7.2 to 22.7.4 (#3139) by @dependabot
- chore(deps): bump @aws-sdk/client-lambda from 3.658.1 to 3.659.0 in the aws-sdk-v3 group across 1 directory (#3127) by @dependabot
- test(logger): migrate to vitest & custom matchers (#3131) by @dreamorosi
- test(event-handler): migrate to vitest (#3126) by @dreamorosi
- test(idempotency): migrate to vitest (#3124) by @dreamorosi
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3116) by @dependabot
- chore(deps): bump @types/node from 22.5.5 to 22.7.2 (#3115) by @dependabot
- chore(deps): bump aws-xray-sdk-core from 3.10.0 to 3.10.1 (#3095) by @dependabot
- chore(deps): bump @aws-cdk/cli-lib-alpha to 2.160.0-alpha.0 (#3118) by @dreamorosi
- chore(deps-dev): bump @faker-js/faker from 9.0.1 to 9.0.2 (#3113) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3110) by @dependabot
- chore(deps): bump esbuild from 0.23.1 to 0.24.0 (#3102) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
b303046
to426f06d
in /.devcontainer (#3108) by @dependabot - chore(deps): bump the aws-sdk-v3 group across 1 directory with 6 updates (#3107) by @dependabot
- chore(deps): bump rollup from 4.21.3 to 4.22.4 (#3106) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3088) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3090) by @dependabot
- chore(deps-dev): bump @faker-js/faker from 9.0.0 to 9.0.1 (#3075) by @dependabot
- chore(deps): bump vite from 5.4.5 to 5.4.6 (#3081) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
f1e8fdc
tob303046
in /.devcontainer (#3080) by @dependabot - test(jmespath): switch tests to vitest (#3079) by @dreamorosi
- test(commons): migrate to vitest (#3060) by @dreamorosi
- chore(deps-dev): bump @vitest/coverage-v8 from 2.1.0 to 2.1.1 (#3068) by @dependabot
- chore(deps): bump @types/node from 22.5.4 to 22.5.5 (#3067) by @dependabot
This release was made possible by the following contributors:
@arnabrahman, @dependabot, @dependabot[bot], @dreamorosi, @garysassano, @github-actions, @github-actions[bot], @leandrodamascena and @scratchclaggy
v2.8.0
Summary
This release introduces 1/ the ability store parameters on AWS System Manager Parameter Store using the Parameters utility, and 2/ a new option for Logger that you can use to specify the order of how keys appear in your JSON-structured logs.
We are also adding a new TRACE
log level to align with AWS Lambda Advanced Logging Controls (ALC), and improved made improvements to errors in the Idempotency utility, which now include more details on the cause of the error.
Finally, you can now use our public AWS Lambda Layers in two new AWS Regions: ap-south-2
and me-central-1
.
⭐️ Thanks to @daschaa, @arnabrahman, and @timo92 for their contributions to this release!
Store parameters using SSM
In response to customer requests, you can now store parameters using AWS System Manager Parameter Store with the setParameter
function. This new helper function fits right in with the other Parameters features you know and love, and provides a seamless experience without having to deal with the AWS SDK.
A big thank you to @daschaa for working on this feature!
Specify log keys order
You can now change the order of the keys in your logs via the logRecordOrder
constructor parameter when using Logger. This is useful when you want to customize how the logs are structured without having to create and maintain your own custom log formatter.
When you specify one or more keys in the logRecordOrder
we’ll place these keys first, followed by all the other keys in the log.
Thank you to @arnabrahman for adding this feature!
v1.x Reached End-of-Life (EOL)
Starting from September 1st 2024, v1.x of Powertools for AWS Lambda (TypeScript) has reached EOL and will not receive any further updates in accordance with our Versioning Policy.
We recommend you to upgrade to v2.x as soon as possible to continue receiving new feature and bug fixes. If you are having issues migrating and need support, please reach out via one of our channels or open a discussion on our repo.
Changes
- chore(deps): bump github/codeql-action from 3.26.6 to 3.26.7 (#3064) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.11 to 3.0.12 (#3034) by @dependabot
- chore(maintenance): switch to unmanaged log group for functions (#3014) by @dreamorosi
- chore(maintenance): remove obsolete workflow (#3016) by @dreamorosi
- chore(deps): bump actions/upload-artifact from 4.3.6 to 4.4.0 (#3006) by @dependabot
- chore(deps): bump actions/setup-python from 5.1.1 to 5.2.0 (#3001) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.5 to 3.26.6 (#2996) by @dependabot
- docs(parameters): review API docs & README for Parameters (#2994) by @am29d
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.10 to 3.0.11 (#2979) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.4 to 3.26.5 (#2978) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.2 to 3.26.4 (#2968) by @dependabot
- chore(deps): bump github/codeql-action from 3.26.1 to 3.26.2 (#2932) by @dependabot
- test(logger): simplify unit tests structure (#2942) by @dreamorosi
- chore(deps): bump github/codeql-action from 3.26.0 to 3.26.1 (#2925) by @dependabot
- test(idempotency): simplify wrapper & middleware tests (#2919) by @dreamorosi
- chore(deps): bump actions/upload-artifact from 4.3.4 to 4.3.6 (#2895) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.15 to 3.26.0 (#2894) by @dependabot
🌟New features and non-breaking changes
- feat(parameters): adds setParameter function to store SSM parameters (#3020) by @daschaa
- feat(logger): introduce log key reordering functionality (#2736) by @arnabrahman
- feat(logger): introduce loglevel trace #1589 (#2902) by @timo92
🌟 Minor Changes
- improv(logger): streamline Logger types (#3054) by @dreamorosi
- improv(tracer): set
AWS_XRAY_CONTEXT_MISSING
toIGNORE_ERROR
when no value is set (#3058) by @dreamorosi - improv(metrics): avoid emitting empty EMF metric (#3044) by @dreamorosi
- improv(parameters): include cause in set parameter error (#3047) by @dreamorosi
- improv(parser): correctly infer helper return type (#2946) by @dreamorosi
📜 Documentation updates
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3066) by @dependabot
- chore(deps-dev): bump tsx from 4.19.0 to 4.19.1 (#3062) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3049) by @dependabot
- docs(tracer): clarify escape hatch mechanism (#3056) by @dreamorosi
- docs(idempotency): add callout about undefined early return (#3055) by @dreamorosi
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3048) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3045) by @dependabot
- feat(parameters): adds setParameter function to store SSM parameters (#3020) by @daschaa
- chore(docs): fix spelling issues (#3039) by @dreamorosi
- chore(deps): bump typescript from 5.5.4 to 5.6.2 (#3041) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3038) by @dependabot
- chore(deps): bump @types/node from 22.5.2 to 22.5.4 (#3026) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#3036) by @dependabot
- feat(logger): introduce log key reordering functionality (#2736) by @arnabrahman
- docs(maintenance): fix install instructions & switch test runner (#3030) by @dreamorosi
- docs(maintenance): mark 1.x as EoL on docs (#3019) by @dreamorosi
- chore(deps): bump mkdocs-material from 9.5.33 to 9.5.34 in /docs (#3005) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
7132ca3
toa2e3a31
in /docs (#3004) by @dependabot - chore(deps): bump @types/node from 22.5.1 to 22.5.2 (#3008) by @dependabot
- chore(deps): bump aws-cdk from 2.145.0 to 2.155.0 in the aws-cdk group across 1 directory (#3007) by @dependabot
- chore(deps): bump @types/node from 22.5.0 to 22.5.1 (#2998) by @dependabot
- chore(deps): bump aws-cdk from 2.145.0 to 2.148.1 (#3003) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2999) by @dependabot
- docs: removed unnecessary exports previously added to api docs (#3000) by @am29d
- chore(deps): bump ts-jest from 29.2.4 to 29.2.5 (#2981) by @dependabot
- chore(deps-dev): bump tsx from 4.17.0 to 4.19.0 (#2986) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.143 to 8.10.145 (#2991) by @dependabot
- chore(deps): bump aws-cdk from 2.145.0 to 2.148.1 (#2988) by @dependabot
- chore(docs): load self hosted mermaid.js (#2977) by @dreamorosi
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2973) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2972) by @dependabot
- chore(deps): bump @types/node from 22.4.1 to 22.5.0 (#2966) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.32 to 9.5.33 in /docs (#2971) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
a73e4bb
to7132ca3
in /docs (#2974) by @dependabot - chore(deps): bump esbuild from 0.23.0 to 0.23.1 (#2950) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2962) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2958) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.31 to 9.5.32 in /docs (#2953) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
9919d6e
toa73e4bb
in /docs (#2952) by @dependabot - chore(deps): bump @types/node from 22.3.0 to 22.4.1 (#2951) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2931) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2941) by @dependabot
- chore(deps): bump @types/node from 22.2.0 to 22.3.0 (#2926) by @dependabot
- docs(logger): add logEventIfEnabled() docs (#2924) by @dreamorosi
- chore(layers): deploy Lambda layers in
ap-south-2
andme-central-1
(#2933) by @dreamorosi - feat(logger): introduce loglevel trace #1589 (#2902) by @timo92
- chore(deps): bump @types/node from 22.1.0 to 22.2.0 (#2914) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2922) by @dependabot
- docs(idempotency): review API docs & README (#2917) by @am29d
- chore(maintenance): replace copy command in docs dockerfile (#2911) by @dreamorosi
- chore(deps): bump @types/aws-lambda from 8.10.142 to 8.10.143 (#2896) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2888) by @dependabot
- chore(deps-dev): bump tsx from 4.16.5 to 4.17.0 (#2907) by @dependabot
🐛 Bug and hot fixes
- fix(tracer): include request pathname in trace data (#2955) by @dreamorosi
- fix...
v2.7.0
Summary
This release 1/ brings a new helper function to parse JSON stringified fields when using Parser, 2/ and improved Metrics, which now can emit metrics using the None
unit.
⭐️ Thanks to @daschaa for fixing Logger and making it default to :UTC when encountering an invalid time zone value.
Quickly parse JSON stringified fields
You can now parse and validate JSON stringified fields using Zod schemas without having to transform them first. This is useful when working with payloads coming from sources that stringify payloads like Amazon API Gateway, Amazon SQS, Amazon Application Load Balancer (ALB), etc.
Use the JSONStringified
helper to extend your schemas or any of the built-in schemas in Parser:
Metrics without unit
You can now create metrics without a unit of measure, this is helpful when your business metrics are tied to an abstract concept or when none of the units supported by the Embedded metric format specification fit.
Changes
- chore(ci): extract cached-node-modules action (#2876) by @dreamorosi
- chore(deps): bump github/codeql-action from 3.25.14 to 3.25.15 (#2855) by @dependabot
- chore(deps): bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#2856) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.13 to 3.25.14 (#2845) by @dependabot
🌟New features and non-breaking changes
- feat(metrics): add unit None for CloudWatch EMF Metrics (#2904) by @am29d
- feat(parser): add helper functions to transform JSON stringified payloads (#2901) by @am29d
📜 Documentation updates
- feat(parser): add helper functions to transform JSON stringified payloads (#2901) by @am29d
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2884) by @dependabot
- chore(deps): bump typescript from 5.4.5 to 5.5.4 (#2820) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2882) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.30 to 9.5.31 in /docs (#2877) by @dependabot
- chore(deps): bump @types/node from 22.0.2 to 22.1.0 (#2879) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
257eca8
to9919d6e
in /docs (#2881) by @dependabot - chore(deps): bump @types/node from 22.0.0 to 22.0.2 (#2872) by @dependabot
- chore(deps-dev): bump tsx from 4.16.3 to 4.16.5 (#2873) by @dependabot
- chore(deps): bump ts-jest from 29.1.5 to 29.2.4 (#2874) by @dependabot
- chore(maintenance): add LocalStack customer reference (#2870) by @dreamorosi
- chore(deps-dev): bump tsx from 4.16.2 to 4.16.3 (#2867) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2866) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2861) by @dependabot
- chore(deps): bump @types/node from 20.14.10 to 22.0.0 (#2852) by @dependabot
- chore: create event-handler utility workspace (#2858) by @dreamorosi
- chore(maintenance): add Banxware & WeSchool customer references (#2859) by @dreamorosi
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2848) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.141 to 8.10.142 (#2849) by @dependabot
- chore(maintenance): remove eslint & prettier (#2841) by @dreamorosi
- chore(maintenance): add caylent as customer reference (#2843) by @dreamorosi
🐛 Bug and hot fixes
🔧 Maintenance
- feat(parser): add helper functions to transform JSON stringified payloads (#2901) by @am29d
- chore(commons): extract lru-cache into commons (#2899) by @dreamorosi
- chore(deps-dev): bump lint-staged from 15.2.7 to 15.2.8 (#2885) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1667.0 to 2.1668.0 (#2890) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2884) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1666.0 to 2.1667.0 (#2886) by @dependabot
- chore(deps): bump typescript from 5.4.5 to 5.5.4 (#2820) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2882) by @dependabot
- chore(deps): bump @types/node from 22.0.2 to 22.1.0 (#2879) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1665.0 to 2.1666.0 (#2880) by @dependabot
- chore(deps): bump @types/node from 22.0.0 to 22.0.2 (#2872) by @dependabot
- chore(deps-dev): bump tsx from 4.16.3 to 4.16.5 (#2873) by @dependabot
- chore(deps): bump ts-jest from 29.1.5 to 29.2.4 (#2874) by @dependabot
- chore(maintenance): add LocalStack customer reference (#2870) by @dreamorosi
- chore(deps-dev): bump tsx from 4.16.2 to 4.16.3 (#2867) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1664.0 to 2.1665.0 (#2868) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2866) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2861) by @dependabot
- chore(deps-dev): bump husky from 9.0.11 to 9.1.4 (#2860) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1663.0 to 2.1664.0 (#2854) by @dependabot
- chore(deps): bump @types/node from 20.14.10 to 22.0.0 (#2852) by @dependabot
- chore: create event-handler utility workspace (#2858) by @dreamorosi
- chore(maintenance): add Banxware & WeSchool customer references (#2859) by @dreamorosi
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2848) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.141 to 8.10.142 (#2849) by @dependabot
- chore(maintenance): remove eslint & prettier (#2841) by @dreamorosi
- chore(parser): adds scoped exports for schemas and envelopes (#2847) by @daschaa
- chore(maintenance): add caylent as customer reference (#2843) by @dreamorosi
- chore(parser): adds exports for Record schemas (#2846) by @daschaa
- chore(deps-dev): bump aws-sdk from 2.1659.0 to 2.1663.0 (#2835) by @dependabot
This release was made possible by the following contributors:
@am29d, @daschaa, and @dreamorosi
v2.6.0
Summary
This release 1/ promotes Parser to Generally Available and ready for production, and 2/ adds support for unsupported types serialization in Logger.
⭐ Big thanks to @daschaa for helping improve our code quality automation
🏅 Congrats to @marlapativ & @sandrokeil on their first contribution
Parser is Generally Available
We want to thank the community who engaged with us, tested Parser during beta, and provided valuable feedback and contributions to improve everyone' experience.
New to Parser?
Parser provides data validation and parsing using Zod, a TypeScript-first schema declaration and validation library, and comes with built-in schemas and envelopes for common AWS event types for AWS Lambda.
To get started with Parser, you also need to install Zod:
npm install @aws-lambda-powertools/parser zod@~3
Next, you can extend one of the schemas using your own schema, and parse the event both with class method decorators (or Middy.js):
Support unserializable types
You can now extend the default logic used to emit JSON-structured logs by passing a custom serializer function to the Logger constructor, using the jsonReplacerFn option. This is useful when you want to customize the serialization of specific values.
Changes
- chore(parser): review imports (#2838) by @dreamorosi
- chore(deps): bump github/codeql-action from 3.25.12 to 3.25.13 (#2789) by @dependabot
- chore(maintenance): migrate jmespath utility to biome (#2807) by @dreamorosi
- chore(maintenance): migrate testing utility to biome (#2808) by @dreamorosi
- chore(maintenance): migrate idempotency utility to biome (#2810) by @dreamorosi
- chore(deps): bump aws-actions/closed-issue-message from 36b7048ea77bb834d16e7a7c5b5471ac767a4ca1 to 80edfc24bdf1283400eb04d20a8a605ae8bf7d48 (#2784) by @dependabot
- chore(deps): bump actions/setup-python from 5.1.0 to 5.1.1 (#2765) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.11 to 3.25.12 (#2771) by @dependabot
🌟New features and non-breaking changes
- feat(parser): allow parser set event type of handler with middy (#2786) by @am29d
- feat(logger): introduce loglevel constant (#2787) by @marlapativ
🌟 Minor Changes
- improv(logger): export LoggerInterface (#2832) by @sandrokeil
📜 Documentation updates
- chore(ci): revert bump version to 2.6.0 (#2836) by @dreamorosi
- chore(docs): Add lambda layer policy to versioning docs (#2824) by @hjgraca
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2818) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.29 to 9.5.30 in /docs (#2815) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2817) by @dependabot
- chore(maintenance): migrate snippets to biome (#2814) by @daschaa
- chore(maintenance): add biome to the project (#2791) by @dreamorosi
- chore(deps): bump mkdocs-material from 9.5.28 to 9.5.29 in /docs (#2778) by @dependabot
🔧 Maintenance
- chore(ci): revert bump version to 2.6.0 (#2836) by @dreamorosi
- chore(parser): mark parser as GA (#2831) by @dreamorosi
- chore(maintenance): migrate parser utility to biome (#2822) by @daschaa
- chore(deps-dev): bump typedoc from 0.26.4 to 0.26.5 in the typedoc group across 1 directory (#2819) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2818) by @dependabot
- chore(maintenance): migrate metrics utility to biome (#2816) by @daschaa
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2817) by @dependabot
- chore(maintenance): migrate parameters utility to biome (#2812) by @dreamorosi
- chore(maintenance): migrate tracer utility to biome (#2809) by @dreamorosi
- chore(maintenance): migrate logger utility to biome (#2813) by @daschaa
- chore(maintenance): migrate batch utility to biome (#2804) by @dreamorosi
- chore(maintenance): migrate commons utility to biome (#2805) by @dreamorosi
- chore(maintenance): migrate layers package to biome (#2806) by @dreamorosi
- chore(maintenance): add biome to the project (#2791) by @dreamorosi
- chore(deps-dev): bump aws-sdk from 2.1657.0 to 2.1659.0 (#2776) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
cf26683
to2ac7b2c
in /.devcontainer (#2770) by @dependabot
This release was made possible by the following contributors:
@am29d, @daschaa, @dreamorosi, @hjgraca, @marlapativ and @sandrokeil
v2.5.0
Summary
The regression on the Parser utility introduced in the last release is resolved in this release. You can now access again the errors that made the validation fail using the cause
property of the ParseError
.
We continue improving our test coverage for the utility during the beta period and before the utility is considered generally available.
Changes
- chore(deps): bump actions/dependency-review-action from 4.3.3 to 4.3.4 (#2772) by @dependabot
- chore(deps): bump actions/setup-node from 4.0.2 to 4.0.3 (#2757) by @dependabot
🌟New features and non-breaking changes
- feat(logger): custom function for unserializable values (JSON replacer) (#2739) by @arnabrahman
📜 Documentation updates
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2766) by @dependabot
- feat(logger): custom function for unserializable values (JSON replacer) (#2739) by @arnabrahman
- chore(deps): bump @types/node from 20.14.9 to 20.14.10 (#2760) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.140 to 8.10.141 (#2761) by @dependabot
- docs(parser): add section on how to test parser using decorator (#2755) by @am29d
🐛 Bug and hot fixes
🔧 Maintenance
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2766) by @dependabot
- chore(deps-dev): bump typedoc from 0.26.3 to 0.26.4 in the typedoc group across 1 directory (#2759) by @dependabot
- chore(deps): bump @types/node from 20.14.9 to 20.14.10 (#2760) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
cad3951
tocf26683
in /.devcontainer (#2756) by @dependabot - chore(deps): bump @types/aws-lambda from 8.10.140 to 8.10.141 (#2761) by @dependabot
This release was made possible by the following contributors:
@am29d, @arnabrahman, @dependabot, @dependabot[bot], @github-actions, @github-actions[bot] and @tusharf5
v2.4.0
Summary
This release improves: 1/ Logger by making it time zone aware, and 2/ Batch Processing which you can now customize to not throw an error when the entire batch of items fails to process.
We also dropped support for Node.js 16, and introduced support for Middy.js 5.x for functions using ES Modules.
🌟 ⭐ Thank you to @arnabrahman for the work on both the new features!
Change timezone in log timestamps
You can now change the timezone used for timestamps in your logs using the TZ
environment variable, which is now taken in account when instantiating a new Logger instance. This is useful for when you want your logs to use a different timezone than the default UTC one.
Working with full batch failures
You can now configure the Batch Processing utility to not throw a FullBatchFailureError
when all the records in the batch fail to process, by setting the throwOnFullBatchFailure
option to false
. This is useful when working with functions that handle batches with a small number of records, or when you use errors as a flow control mechanism.
End of support for Node.js 16
Three months ago we announced that we would stop supporting Node.js 16, and today we are removing support.
End of support does not impact existing functions and functions using versions of Powertools for AWS Lambda (TypeScript) up to version 2.3.0, however starting from this release we no longer guarantee compatibility with Node.js 16.
We recommend that you upgrade your existing Node.js 16 functions to Node.js 18 or later if you want to use Powertools for AWS Lambda (TypeScript) version 2.4.0 and above.
Changes
- chore(ci): revert enable CodeQl (#2731) (#2740) by @dreamorosi
- chore(deps): bump github/codeql-action from 3.23.0 to 3.25.11 (#2745) by @dependabot
- chore(deps): bump actions/download-artifact from 4.1.7 to 4.1.8 (#2746) by @dependabot
- chore(deps): bump actions/upload-artifact from 4.3.3 to 4.3.4 (#2744) by @dependabot
- chore(ci): enable CodeQl (#2731) by @dreamorosi
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.9 to 3.0.10 (#2729) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.10 to 3.25.11 (#2719) by @dependabot
- chore(ci): update Dependabot groups for typedoc (#2716) by @dreamorosi
🌟New features and non-breaking changes
- feat(internal): support Middy.js 5.x (#2748) by @dreamorosi
- feat(batch): add option to not throw
FullBatchFailureError
when the entire batch fails (#2711) by @arnabrahman - feat(logger): time zone aware timestamp in Logger (#2710) by @arnabrahman
- feat(maintenance): drop support for Node.js 16.x (#2717) by @dreamorosi
- chore(layers): deploy Lambda layers in
ap-south-2
andme-central-1
(#2675) by @dreamorosi
📜 Documentation updates
- chore(layers): revert deploy Lambda layers in
ap-south-2
andme-central-1
(#2762) by @dreamorosi - chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2754) by @dependabot
- feat(internal): support Middy.js 5.x (#2748) by @dreamorosi
- feat(batch): add option to not throw
FullBatchFailureError
when the entire batch fails (#2711) by @arnabrahman - chore(deps): bump certifi from 2023.11.17 to 2024.7.4 in /docs (#2738) by @dependabot
- chore(deps-dev): bump tsx from 4.16.0 to 4.16.2 (#2732) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2733) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.27 to 9.5.28 in /docs (#2728) by @dependabot
- feat(logger): time zone aware timestamp in Logger (#2710) by @arnabrahman
- feat(maintenance): drop support for Node.js 16.x (#2717) by @dreamorosi
- chore(deps): bump esbuild from 0.21.5 to 0.23.0 (#2722) by @dependabot
- chore(deps-dev): bump tsx from 4.15.7 to 4.16.0 (#2718) by @dependabot
- chore(layers): deploy Lambda layers in
ap-south-2
andme-central-1
(#2675) by @dreamorosi - chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2712) by @dependabot
- chore(layers): downgrade aws cdk to 2.145.0 (#2700) by @dreamorosi
🐛 Bug and hot fixes
- fix(idempotency): check error identity via names (#2747) by @dreamorosi
🔧 Maintenance
- chore(deps-dev): bump aws-sdk from 2.1652.0 to 2.1657.0 (#2753) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2754) by @dependabot
- feat(internal): support Middy.js 5.x (#2748) by @dreamorosi
- chore(deps-dev): bump aws-sdk from 2.1651.0 to 2.1652.0 (#2726) by @dependabot
- chore(deps-dev): bump tsx from 4.16.0 to 4.16.2 (#2732) by @dependabot
- chore(deps): bump the aws-sdk-v3 group across 1 directory with 9 updates (#2733) by @dependabot
- feat(maintenance): drop support for Node.js 16.x (#2717) by @dreamorosi
- chore(deps): bump esbuild from 0.21.5 to 0.23.0 (#2722) by @dependabot
- chore(deps-dev): bump tsx from 4.15.7 to 4.16.0 (#2718) by @dependabot
- chore(deps-dev): bump the typedoc group across 1 directory with 3 updates (#2720) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1649.0 to 2.1651.0 (#2714) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2712) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1648.0 to 2.1649.0 (#2706) by @dependabot
- chore(layers): downgrade AWS CDK to 2.145.0 part 2 (#2702) by @dreamorosi
- chore(layers): downgrade aws cdk to 2.145.0 (#2700) by @dreamorosi
This release was made possible by the following contributors:
@arnabrahman, and @dreamorosi
v2.3.0
Summary
This release improves Logger with (1) a more consistent handling of additional keys, and (2) a new method to reset keys. It also brings improvements to Parser with (1) more accurate API Gateway built-in schemas, and (2) better API reference.
We also fixed a bug with log sampling in Logger, and with the Idempotency decorator not preserving class scope.
🌟 ⭐ Thank you to @shdq for the work on the Logger improvements.
Working with additional keys in Logger
We have streamlined the experience for adding, removing, and resetting additional keys in Logger.
Temporary keys
You can add temporary keys to all future log messages via the appendKeys()
method. This is helpful to contextualize log messages emitted within a specific function.
We have also added a new resetKeys()
method to easily remove any temporary keys you have added, this is useful when you add multiple custom keys conditionally or when you emit canonical or wide logs.
Persistent keys
You can now also persist keys across Lambda invocations by using the persistentKeys
constructor option or the appendPersistentKeys()
method.
These keys will now persist even if you call the resetKeys()
method.
A common use case is to set keys about your environment or application version, so that you can easily filter logs in CloudWatch Logs.
The following properties and methods are now marked as deprecated and will be removed in the next major release:
persistentLogAttributes
constructor option is replaced bypersistentKeys
- addPersistentLogAttributes() and setPersistentLogAttributes() methods are replaced by appendPersistentKeys()
removePersistentLogAttributes()
method is replaced byremovePersistentKeys()
New API Gateway built-in schemas in Parser
You can now use more accurate schemas for a fine grained validation and parsing, as well as improved type hinting, and code completion support.
API Gateway REST APIs:
- [New]
APIGatewayRequestAuthorizerEventSchema
for request parameter-based Lambda authorizer (REQUEST authorizer) - [New]
APIGatewayTokenAuthorizerEventSchema
for token-based Lambda authorizer (TOKEN authorizer) - [Updated]
APIGatewayProxyEventSchema
for Lambda proxy integration
API Gateway HTTP APIs:
- [New]
APIGatewayRequestAuthorizerEventV2Schema
for Lambda authorizer - [Updated]
APIGatewayProxyEventV2Schema
for Lambda proxy integration
Improved API reference docs for Parser
You can now get details on built-in schemas and envelopes both within our online documentation (i.e. APIGatewayProxyEventSchema
) and by hovering definitions without leaving your IDE.
Changes
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.7 to 3.0.9 (#2664) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.9 to 3.25.10 (#2656) by @dependabot
- chore(deps): bump actions/checkout from 4.1.6 to 4.1.7 (#2650) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.8 to 3.25.9 (#2651) by @dependabot
🌟New features and non-breaking changes
- feat(parser): enhance API Gateway schemas (#2665) by @dreamorosi
- feat(logger): add
clearState()
method (#2408) by @shdq
📜 Documentation updates
- chore(layers): downgrade aws cdk to 2.145.0 (#2700) by @dreamorosi
- docs(logger): rework working with keys doc sections (#2696) by @dreamorosi
- chore(deps): bump the aws-sdk group across 1 directory with 4 updates (#2689) by @dependabot
- chore(deps-dev): bump tsx from 4.15.6 to 4.15.7 (#2684) by @dependabot
- chore(deps): bump @types/node from 20.14.6 to 20.14.9 (#2691) by @dependabot
- docs(parser): add api docs (#2685) by @am29d
- feat(parser): enhance API Gateway schemas (#2665) by @dreamorosi
- chore(deps): bump @types/node from 20.14.2 to 20.14.6 (#2678) by @dependabot
- chore(deps): bump ts-jest from 29.1.4 to 29.1.5 (#2661) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2672) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.138 to 8.10.140 (#2670) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2658) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
96abcbb
to257eca8
in /docs (#2662) by @dependabot - chore(deps): bump mkdocs-material from 9.5.26 to 9.5.27 in /docs (#2663) by @dependabot
- chore(deps): bump urllib3 from 2.1.0 to 2.2.2 in /docs (#2666) by @dependabot
- chore(deps-dev): bump tsx from 4.15.4 to 4.15.6 (#2660) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2652) by @dependabot
- chore(deps): bump esbuild from 0.21.4 to 0.21.5 (#2635) by @dependabot
- chore(deps-dev): bump tsx from 4.15.1 to 4.15.4 (#2641) by @dependabot
🐛 Bug and hot fixes
- fix(idempotency): preserve scope of decorated class (#2693) by @dreamorosi
- fix(logger): reset log level after sampling refresh (#2673) by @dreamorosi
🔧 Maintenance
- chore(layers): downgrade AWS CDK to 2.145.0 part 2 (#2702) by @dreamorosi
- chore(layers): downgrade aws cdk to 2.145.0 (#2700) by @dreamorosi
- chore(deps): bump the aws-sdk group across 1 directory with 4 updates (#2689) by @dependabot
- chore(deps-dev): bump tsx from 4.15.6 to 4.15.7 (#2684) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1645.0 to 2.1648.0 (#2690) by @dependabot
- chore(deps): bump @types/node from 20.14.6 to 20.14.9 (#2691) by @dependabot
- docs(parser): add api docs (#2685) by @am29d
- feat(parser): enhance API Gateway schemas (#2665) by @dreamorosi
- chore(deps-dev): bump typedoc-plugin-missing-exports from 2.2.0 to 2.3.0 (#2655) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1642.0 to 2.1645.0 (#2679) by @dependabot
- chore(deps): bump @types/node from 20.14.2 to 20.14.6 (#2678) by @dependabot
- chore(deps): bump ts-jest from 29.1.4 to 29.1.5 (#2661) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2672) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.138 to 8.10.140 (#2670) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2658) by @dependabot
- chore(deps-dev): bump tsx from 4.15.4 to 4.15.6 (#2660) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1640.0 to 2.1642.0 (#2657) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2652) by @dependabot
- chore(deps-dev): bump lint-staged from 15.2.5 to 15.2.7 (#2642) by @dependabot
- chore(deps): bump esbuild from 0.21.4 to 0.21.5 (#2635) by @dependabot
- chore(deps-dev): bump hashi-vault-js from 0.4.14 to 0.4.15 (#2634) by @dependabot
- chore(deps-dev): bump tsx from 4.15.1 to 4.15.4 (#2641) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1639.0 to 2.1640.0 (#2649) by @dependabot
This release was made possible by the following contributors:
@am29d, @dreamorosi, and @shdq
v2.2.0
Summary
This release improves 1/ Idempotency now handles payloads with out-of-order keys and functions with no return value, and 2/ Batch Processing can optionally continue processing messages with different group IDs for SQS FIFO queues.
🌟 ⭐ Special thanks to our contributors @daschaa and @arnabrahman - thank you for your work on this release!
Idempotency
Deep sort payload
⚠️ Previously processed transactions with out-of-order keys might lose idempotency guarantees
We now sort payloads before creating an idempotency key. Before, we were serializing them with the keys in the order they were provided.
In use cases where the client can send out-of-order payloads like REST APIs, browser clients, and proxies this could have caused the request to not be idempotent.
For example, the following two payloads would have resulted in two different hashes before this release:
Make functions idempotent with no return value
You can now make your function idempotent even if it returns no value. This is useful when your want to trigger AWS Step Functions workflow, or fire-and-forget other services or APIs. Before, Idempotency required an explicit return value and would have failed if not provided.
Batch Processing
Skip processing failed group id messages of SQS FIFO queues on error
You have now a new flag skipGroupOnError to return the messages from a failed group ID back to SQS and continue processing messages from subsequent group IDs. Previously, Batch stopped processing upon any failure regardless of the message group ID.
Parser (beta)
Fix sourceIp validation for APIGatewayProxyEvent for Management Console
APIGatewayProxyEvent
is now compatible with the test payload from Amazon API Gateway Console. When testing an endpoint from the AWS Console, API Gateway sends a mock source IP value, test-invoke-source-ip
, causing the validation to fail. The Parser utility now includes an override to handle this edge case.
Changes
- test(idempotency): fix integration tests (#2622) by @dreamorosi
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.6 to 3.0.7 (#2628) by @dependabot
- chore(deps): bump actions/dependency-review-action from 4.3.2 to 4.3.3 (#2614) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.7 to 3.25.8 (#2610) by @dependabot
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.5 to 3.0.6 (#2599) by @dependabot
- chore(deps): bump github/codeql-action from 3.25.6 to 3.25.7 (#2593) by @dependabot
- chore(idempotency): expiration timestamp rounded to the nearest second (#2574) by @arnabrahman
- chore(deps): bump github/codeql-action from 3.25.5 to 3.25.6 (#2565) by @dependabot
- chore(deps): bump actions/checkout from 4.1.5 to 4.1.6 (#2548) by @dependabot
- chore(ci): Adopt multi directory config for dependabot (#2532) by @daschaa
- chore(parameters): Use AppConfig L2 constructs for integration tests (#2524) by @daschaa
🌟New features and non-breaking changes
- feat(batch): add option to continue processing other group IDs on failure in
SqsFifoPartialProcessor
(#2590) by @arnabrahman - fix(idempotency): deep sort payload during hashing (#2570) by @arnabrahman
🌟 Minor Changes
- improv(idempotency): handle functions with no return value (#2521) by @dreamorosi
- improv(tracer): remove require in tracer provider (#2557) by @dreamorosi
📜 Documentation updates
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2644) by @dependabot
- docs(tracer): add ESM instructions to tracer usage docs (#2630) by @dreamorosi
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2626) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2619) by @dependabot
- chore(deps-dev): bump tsx from 4.13.2 to 4.15.1 (#2629) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
8a87f05
to96abcbb
in /docs (#2615) by @dependabot - chore(deps-dev): bump tsx from 4.12.0 to 4.13.2 (#2620) by @dependabot
- chore(deps-dev): bump tsx from 4.11.2 to 4.12.0 (#2612) by @dependabot
- chore(deps): bump mkdocs-material from 9.5.25 to 9.5.26 in /docs (#2616) by @dependabot
- chore(deps): bump @types/node from 20.14.1 to 20.14.2 (#2608) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2606) by @dependabot
- chore(deps): bump @types/node from 20.14.0 to 20.14.1 (#2603) by @dependabot
- feat(batch): add option to continue processing other group IDs on failure in
SqsFifoPartialProcessor
(#2590) by @arnabrahman - chore(deps): bump @types/node from 20.12.13 to 20.14.0 (#2601) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 11 updates (#2598) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2591) by @dependabot
- chore(deps): bump @types/node from 20.12.12 to 20.12.13 (#2595) by @dependabot
- chore(deps): bump ts-jest from 29.1.3 to 29.1.4 (#2586) by @dependabot
- chore(deps): bump esbuild from 0.21.3 to 0.21.4 (#2583) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2578) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
5358893
to8a87f05
in /docs (#2584) by @dependabot - chore(deps): bump mkdocs-material from 9.5.24 to 9.5.25 in /docs (#2585) by @dependabot
- chore(deps-dev): bump tsx from 4.10.5 to 4.11.0 (#2575) by @dependabot
- docs(batch): review API docs & README (#2562) by @dreamorosi
- chore(deps): bump requests from 2.31.0 to 2.32.0 in /docs (#2563) by @dependabot
- chore(deps): bump ts-jest from 29.1.2 to 29.1.3 (#2567) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
48d1914
to5358893
in /docs (#2553) by @dependabot - chore(deps): bump mkdocs-material from 9.5.23 to 9.5.24 in /docs (#2554) by @dependabot
- chore(deps): bump @types/aws-lambda from 8.10.137 to 8.10.138 (#2545) by @dependabot
- chore(deps-dev): bump tsx from 4.10.3 to 4.10.5 (#2549) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2544) by @dependabot
- chore(deps): bump esbuild from 0.21.2 to 0.21.3 (#2537) by @dependabot
- chore(deps): bump squidfunk/mkdocs-material from
8ef47d7
to48d1914
in /docs (#2533) by @dependabot - chore(deps): bump mkdocs-material from 9.5.22 to 9.5.23 in /docs (#2534) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2536) by @dependabot
- chore(deps-dev): bump tsx from 4.10.2 to 4.10.3 (#2538) by @dependabot
- chore(deps): bump @types/node from 20.12.11 to 20.12.12 (#2529) by @dependabot
- chore(deps): bump esbuild from 0.21.1 to 0.21.2 (#2512) by @dependabot
🐛 Bug and hot fixes
- fix(idempotency): deep sort payload during hashing (#2570) by @arnabrahman
- fix(parser): handle API Gateway Test UI sourceIp (#2531) by @dreamorosi
🔧 Maintenance
- chore(deps-dev): pin lerna to 8.1.2 (#2646) by @dreamorosi
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2644) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1637.0 to 2.1639.0 (#2638) by @dependabot
- chore(deps-dev): bump prettier from 3.3.1 to 3.3.2 (#2633) by @dependabot
- chore(deps): bump aws-xray-sdk-core from 3.6.0 to 3.9.0 (#2631) by @dependabot
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#2626) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1636.0 to 2.1637.0 (#2627) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2619) by @dependabot
- chore(deps-dev): bump tsx from 4.13.2 to 4.15.1 (#2629) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1634.0 to 2.1636.0 (#2617) by @dependabot
- chore(deps-dev): bump tsx from 4.12.0 to 4.13.2 (#2620) by @dependabot
- chore(deps-dev): bump tsx from 4.11.2 to 4.12.0 (#2612) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1633.0 to 2.1634.0 (#2609) by @dependabot
- chore(deps): bump @types/node from 20.14.1 to 20.14.2 (#2608) by @dependabot
- chore(deps-dev): bump prettier from 3.3.0 to 3.3.1 (#2607) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2606) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1632.0 to 2.1633.0 (#2604) by @dependabot
- chore(deps): bump @types/node from 20.14.0 to 20.14.1 (#2603) by @dependabot
- chore(deps): bump @types/node from 20.12.13 to 20.14.0 (#2601) by @dependabot
- chore(deps): bump the aws-sdk group across 1 directory with 11 updates (#2598) by @dependabot
- chore(deps): bump vscode/devcontainers/javascript-node from
bbd5e0f
tocad3951
in /.devcontainer (#2592) by @dependabot - chore(deps): bump the aws-sdk group across 1 directory with 9 updates (#2591) by @dependabot
- chore(deps-dev): bump aws-sdk from 2.1628.0 to 2.1631.0 (#2596) by @dependabot
- chore(deps): bump @types/node from 20.12.12 to 20.12.13 (#2595) by @dependabot
- chore(deps): bump ts-jest from 29.1.3 to 29.1.4 (#2586) by @dependabot
- chore(deps): bump esbuild from 0.21.3 to 0.2...