Skip to content

Releases: aws-powertools/powertools-lambda-python

v2.22.0

27 Jul 20:03
Compare
Choose a tag to compare

Summary

This release follows the newly announced Python 3.11 runtime in AWS Lambda 🚀. It also adds a revamped Batch Processing documentation, along with numerous bug fixes.

⭐ Huge thanks to new contributors: @94Sip and @duc00 for helping us improve Batch's documentation

Batch Processing documentation

Docs

This release adds a new error handling section, contextual information in key code snippets, and several new diagrams to improve understanding about Batch Processors and AWS Lambda Report Item Batch Failure feature.

New Error Handling section

New sequence diagrams

Changes

🌟New features and non-breaking changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(logger): strip xray_trace_id when explicitly disabled (#2852) by @heitorlessa
  • fix(parameters): distinct cache key for single vs path with same name (#2839) by @heitorlessa

🔧 Maintenance

  • chore(deps-dev): bump cfn-lint from 0.78.2 to 0.79.3 (#2854) by @dependabot
  • docs(navigation): add nofollow attribute (#2842) by @leandrodamascena
  • chore(deps-dev): bump mypy-boto3-lambda from 1.28.0 to 1.28.11 (#2845) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.18.28 to 1.18.29 in /layer/scripts/layer-balancer (#2844) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/service/lambda from 1.37.1 to 1.38.0 in /layer/scripts/layer-balancer (#2843) by @dependabot
  • chore(deps-dev): bump mypy-boto3-dynamodb from 1.28.0 to 1.28.11 (#2847) by @dependabot
  • chore(deps): bump pydantic from 1.10.11 to 1.10.12 (#2846) by @dependabot
  • chore(deps-dev): bump mypy-boto3-cloudformation from 1.28.0 to 1.28.10 (#2837) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.279 to 0.0.280 (#2836) by @dependabot
  • chore(ci): add baking time for layer build (#2834) by @heitorlessa
  • feat(general): add support for Python 3.11 (#2820) by @rubenfonseca
  • chore(ci): build changelog on a schedule only (#2832) by @heitorlessa
  • chore(deps-dev): bump ruff from 0.0.278 to 0.0.279 (#2822) by @dependabot
  • chore(deps): bump actions/setup-python from 4.6.1 to 4.7.0 (#2821) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.78.1 to 0.78.2 (#2823) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena, @ran-isenberg and @rubenfonseca

v2.21.0

21 Jul 15:41
Compare
Choose a tag to compare

Summary

We are happy to announce the official support for Pydantic V2. 🚀🚀🚀🚀

This offers you the flexibility to choose between Pydantic v1 and v2 with no breaking changes. This 3-week significant effort wouldn’t be possible without many Pydantic experts from our community, and the Pydantic team for fixing a regression - thank you!!

New public reference. A big thank you to @ovahal at Jit Security.

⭐ Huge thanks to our new contributor: @tinti!

Support for Pydantic v2

Docs

Pydantic recently released version 2, bringing a plethora of exciting improvements and enhancements.

We did an extensive research on breaking changes between v1 and v2 to provide a smooth transition, when using Powertools for AWS Lambda (Python) Parser models and envelopes.

image

Changes

🌟New features and non-breaking changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(docs): remove redundant code in the tutorial section (#2796) by @tinti

🔧 Maintenance

  • feat(parser): add support for Pydantic v2 (#2733) by @leandrodamascena
  • chore(deps-dev): bump aws-cdk from 2.87.0 to 2.88.0 (#2812) by @dependabot
  • chore(deps-dev): bump types-requests from 2.31.0.1 to 2.31.0.2 (#2806) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.28.3.post2 to 1.28.8 (#2808) by @dependabot
  • chore(deps-dev): bump types-python-dateutil from 2.8.19.13 to 2.8.19.14 (#2807) by @dependabot
  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.28.3.post1 to 1.28.3.post2 (#2794) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from a28ed81 to 33e28bd in /docs (#2797) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.18 to 9.1.19 (#2798) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.28.3.post1 to 1.28.3.post2 (#2793) by @dependabot
  • chore(security): improve debugging for provenance script (#2784) by @heitorlessa
  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.28.3 to 1.28.3.post1 (#2785) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.28.3 to 1.28.3.post1 (#2786) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena and @tinti

v2.20.0

14 Jul 13:20
Compare
Choose a tag to compare

Summary

This release introduces signed and verifiable builds for PyPi, and a new documentation section to make our automation practices, maintainers playbook, and soon a re-imagined contributing guide more visible.

Love automation and CI/CD? We did an interview to walk through what's now documented under our new Automation section:

image

Verifying signed builds

Docs

As of today's release, you can now publicly verify our builds came from a trusted source to further strengthen supply chain security. We created a new Security section in our documentation with steps you can take to verify releases.

You can skip this part if you're not interested in the supply chain security space

For the past few months, we've been working hard to improve our operational and security posture. The biggest chunk of work was introducing Open Source Security Foundation (OSSF) Scorecard project to generate security health metrics, proactive security alerts, and attest we've been following OSSF Best Practices.

We couldn't be happier with the results.

Open Source Security Foundation Best Practices

Through the research, we've learned about SLSA as a framework to produce verifiable reproducible builds within our release pipeline. This enables our more security conscious customers to guarantee our releases came from this repository and every step can be publicly traced back.

Provenance step within our release pipeline to attest its reproducibility and authenticity

image

Changes

🌟New features and non-breaking changes

📜 Documentation updates

  • docs(process): explain our integration automated checks; revamp navigation (#2764) by @heitorlessa
  • chore(ci): introduce provenance and attestation in release (#2746) by @heitorlessa
  • feat(metrics): support to set default dimension in EphemeralMetrics (#2748) by @leandrodamascena
  • docs(batch): fix custom batch processor example (#2714) by @heitorlessa
  • docs(maintainers): add cicd pipeline diagram (#2692) by @heitorlessa
  • docs(contributing): add code integration journey graph (#2685) by @heitorlessa
  • chore(ci): enforce pip --require-hashes to maybe satistify scorecard (#2679) by @heitorlessa
  • chore(deps): bump squidfunk/mkdocs-material from 3837c0f to a28ed81 in /docs (#2669) by @dependabot
  • chore(ci): use deps sha for docs and gitpod images based on ossf findings (#2662) by @heitorlessa

🐛 Bug and hot fixes

  • fix(logger): ensure logs stream to stdout by default, not stderr (#2736) by @heitorlessa
  • fix(docs): ensure alias is applied to versioned releases (#2644) by @sthulb
  • fix(docs): ensure version alias is in an array to prevent "you're not viewing the latest version" incorrect message (#2629) by @sthulb

🔧 Maintenance

  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.28.0 to 1.28.3 (#2773) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/service/lambda from 1.37.0 to 1.37.1 in /layer/scripts/layer-balancer (#2769) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.28.0 to 1.28.1 (#2772) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.18.27 to 1.18.28 in /layer/scripts/layer-balancer (#2770) by @dependabot
  • chore(deps): bump actions/setup-python from 4.6.1 to 4.7.0 (#2768) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2 from 1.18.1 to 1.19.0 in /layer/scripts/layer-balancer (#2771) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.28.0 to 1.28.3 (#2774) by @dependabot
  • docs(process): explain our integration automated checks; revamp navigation (#2764) by @heitorlessa
  • chore(deps-dev): bump cfn-lint from 0.77.10 to 0.78.1 (#2757) by @dependabot
  • chore(deps): bump pypa/gh-action-pypi-publish from 1.8.7 to 1.8.8 (#2754) by @dependabot
  • chore(deps-dev): bump pytest-asyncio from 0.21.0 to 0.21.1 (#2756) by @dependabot
  • chore(deps): bump docker/setup-buildx-action from 2.9.0 to 2.9.1 (#2755) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.277 to 0.0.278 (#2758) by @dependabot
  • chore(streaming): replace deprecated Version classes from distutils (#2752) by @leandrodamascena
  • chore(ci): introduce provenance and attestation in release (#2746) by @heitorlessa
  • chore(deps-dev): bump sentry-sdk from 1.27.1 to 1.28.0 (#2741) by @dependabot
  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.27.0 to 1.28.0 (#2739) by @dependabot
  • chore(deps-dev): bump mypy-boto3-dynamodb from 1.27.0 to 1.28.0 (#2740) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.3 to 2.1.4 (#2738) by @dependabot
  • chore(deps-dev): bump mypy-boto3-xray from 1.27.0 to 1.28.0 (#2720) by @dependabot
  • chore(deps-dev): bump mypy-boto3-ssm from 1.27.0 to 1.28.0 (#2724) by @dependabot
  • chore(deps-dev): bump mypy-boto3-logs from 1.27.0 to 1.28.1 (#2723) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.27.0 to 1.28.0 (#2721) by @dependabot
  • chore(deps-dev): bump mypy-boto3-appconfig from 1.27.0 to 1.28.0 (#2722) by @dependabot
  • chore(deps): bump docker/setup-buildx-action from 2.8.0 to 2.9.0 (#2718) by @dependabot
  • chore(governance): update active maintainers list (#2715) by @heitorlessa
  • chore(ci): prevent sast codeql to run in forks (#2711) by @heitorlessa
  • chore(user-agent): support patching botocore session (#2614) by @roger-zhangg
  • chore(deps-dev): bump mypy-boto3-cloudwatch from 1.27.0 to 1.28.0 (#2697) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.86.0 to 2.87.0 (#2696) by @dependabot
  • chore(deps-dev): bump mypy-boto3-lambda from 1.27.0 to 1.28.0 (#2698) by @dependabot
  • chore(deps-dev): bump mypy-boto3-appconfigdata from 1.27.0 to 1.28.0 (#2699) by @dependabot
  • chore(deps-dev): bump mypy-boto3-cloudformation from 1.27.0 to 1.28.0 (#2700) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.27.0 to 1.27.1 (#2701) by @dependabot
  • chore(ci): address ossf scorecard findings on npm, pip, and top-level permission leftover (#2694) by @heitorlessa
  • docs(maintainers): add cicd pipeline diagram (#2692) by @heitorlessa
  • chore(deps): bump actions/setup-node from 3.6.0 to 3.7.0 (#2689) by @dependabot
  • docs(contributing): add code integration journey graph (#2685) by @heitorlessa
  • chore(deps-dev): bump ruff from 0.0.276 to 0.0.277 (#2682) by @dependabot
  • chore(ci): enforce pip --require-hashes to maybe satistify scorecard (#2679) by @heitorlessa
  • chore(ci): add gitleaks in pre-commit hooks as an extra safety measure (#2677) by @step-security-bot
  • chore(deps): bump pydantic from 1.10.10 to 1.10.11 (#2671) by @dependabot
  • chore(deps-dev): bump typed-ast from 1.5.4 to 1.5.5 (#2670) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 3837c0f to a28ed81 in /docs (#2669) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.275 to 0.0.276 (#2655) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.26.0 to 1.27.0 (#2652) by @dependabot
  • chore(deps): migrate from retry to retry2 to address CVE-2022-42969 (#2665) by @heitorlessa
  • chore(ci): use sast on every commit on any supported language (#2646) by @heitorlessa
  • chore(ci): use deps sha for docs and gitpod images based on ossf findings (#2662) by @heitorlessa
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.17.8 to 1.18.27 in /layer/scripts/layer-balancer (#2651) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2/service/lambda from 1.24.6 to 1.37.0 in /layer/scripts/layer-balancer (#2653) by @dependabot
  • chore(deps): bump golang.org/x/sync from 0.1.0 to 0.3.0 in /layer/scripts/layer-balancer (#2649) by @dependabot
  • chore(deps): bump actions/dependency-review-action from 2.5.1 to 3.0.6 (#2650) by @dependabot
  • chore(deps): bump github.com/aws/aws-sdk-go-v2 from 1.16.16 to 1.18.1 in /layer/scripts/layer-balancer (#2654) by @dependabot
  • chore(ci): improves dependabot based on ossf scorecard recommendations (#2647) by @step-security-bot
  • chore(ci): propagate checkout permission to nested workflows (#2642) by @heitorlessa
  • chore(ci): enforce top-level permission to minimum fail-safe permission as per openssf (#2638) by @step-security-bot
  • chore(ci): prevent merging PRs that do not meet minimum requirements (#2639) by @heitorlessa
  • chore(deps-dev): bump mypy-boto3-appconfigdata from 1.26.70 to 1.27.0 (#2636) by @dependabot
  • chore(deps): bump pydantic from 1.10.9 to 1.10.10 (#2624) by @dependabot
  • chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.158 to 1.26.164 (#2622) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena, @roger-zhangg, @step-security-bot and @sthulb

v2.19.0

30 Jun 12:10
Compare
Choose a tag to compare

Summary

In this new release we added:

  • support for Amazon VPC Lattice integrations
  • a new way to decode nested messages from SQS events
  • tons of documentation updates for the Idempotency utility

⭐ Huge thanks to our new contributor: @rafaelgsr!

Amazon VPC Lattice integration

Docs: event handler, parser

Amazon VPC Lattice is a fully managed application networking service that you use to connect, secure, and monitor the services for your application across multiple accounts and virtual private clouds (VPC). You can register your Lambda functions as targets with a VPC Lattice target group, and configure a listener rule to forward requests to the target group for your Lambda function.

We have added support for handling events from Amazon VPC Lattice in the event handler, using the same API as existing event handlers. This includes important functionalities like CORS support and response header serialization.

carbon (13)

In addition, we added the corresponding Pydantic Parser model for the VPC Lattice event:

carbon (14)

Decoding nested messages from SQS events

SQS events can encapsulate events originated in other AWS resources, such as S3 and SNS. To improve the experience when creating Lambda functions to handle those events, we created a new method to decoded those nested events easily. For instance, this is how you access the nested S3 event from an SQS event:

carbon (15)

Changes

🌟New features and non-breaking changes

📜 Documentation updates

🐛 Bug and hot fixes

🔧 Maintenance

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @hjgraca, @leandrodamascena, @rafaelgsr, @ran-isenberg and @rubenfonseca

v2.18.0

23 Jun 13:27
Compare
Choose a tag to compare

Summary

This release adds support for A/B testing in Feature Flags, and the ability to enable/disable compression for custom responses in Event Handler.

⭐ Huge thanks to our new contributor: @ajwad-shaikh

Feature Flags

Docs

You can now run experiments on a percentage of customers (e.g., A/B testing) with the new MODULE_RANGE action.

image
image

Event Handler

Docs

You can now enable GZIP compression with custom responses. This is useful when you only want to compress certain responses, or override compression for non-200 HTTP status code.

image

Changes

🌟New features and non-breaking changes

  • feat(feature_flags): add modulo range condition for segmented experimentation support (#2331) by @ajwad-shaikh

📜 Documentation updates

  • docs(homepage): fix .NET repository link (#2549) by @hjgraca
  • docs(homepage): add Open Source Security Foundation badge; update links to new url (#2545) by @heitorlessa
  • docs(navigation): make Key Feature the first section (#2517) by @leandrodamascena
  • feat(feature_flags): add modulo range condition for segmented experimentation support (#2331) by @ajwad-shaikh

🐛 Bug and hot fixes

🔧 Maintenance

This release was made possible by the following contributors:

@ajwad-shaikh, @dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @hjgraca, @leandrodamascena and @sthulb

v2.17.0

16 Jun 11:01
Compare
Choose a tag to compare

Summary

This release is full of new features and important bug fixes:

  • we now treat missing idempotency keys as non-idempotent transactions (no-op)
  • we now proritize the most specific route in event handler
  • new event source data classes for Amazon VPC Lattice Events and AWS Config Rules
  • new parser support for CloudFormation Custom Resources
  • better typing support when bringing your own Logger formatter
  • tons of documentation fixes and improvements

⭐ Huge thanks to new contributors: @abbasyadollahi @erikayao93 and @stephenbawks!

Idempotency

We now handle scenarios where the idempotency key might be optional by skipping the persistence storage layer operations (CRUD).

Here’s an example where uniqueness is dictated by X-Idempotency-Key header, but it might be optional:

carbon (9)

Imagine we have three disctinct requests, where the headers key looks like this:

  • First request: {"headers": {"X-Idempotency-Key": "7ca32179-f88f..."}}
  • Second request: {"headers": {}}
  • Third request: {"headers": {}}

With this fix, the first request will follow the current idempotency mechanism while the second and third request will not trigger any idempotency mechanism to prevent unwanted side effects (e.g., idempotency key of None is hashed).

Prioritizing most specific routes in event handler

We made a significant change in the way routes are matched on the event handler by giving priority to the most specific routes.

Consider the following code:

carbon (10)

With this fix, a GET request to /studies/fetch will now match the fetch_studies handler, even though it was declared last.

Support for VPC Lattice and AWS Config Rule events

Docs: Amazon VPC Lattice, AWS Config Rules

We made it easier to work with events comming from Amazon VPC Lattice and AWS Config Rules.

carbon (11)

carbon (12)

Changes

🌟New features and non-breaking changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(idempotency): treat missing idempotency key as non-idempotent transaction (no-op) when raise_on_no_idempotency_key is False (#2477) by @leandrodamascena
  • fix(event_handler): prioritize static over dynamic route to prevent order of route registration mismatch (#2458) by @rubenfonseca

🔧 Maintenance

  • chore(deps-dev): bump mkdocs-material from 9.1.15 to 9.1.16 (#2470) by @dependabot
  • chore(deps-dev): bump flake8-comprehensions from 3.12.0 to 3.13.0 (#2471) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.77.8 to 0.77.9 (#2472) by @dependabot
  • chore(deps): bump aws-actions/configure-aws-credentials from 2.1.0 to 2.2.0 (#2469) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.83.1 to 2.84.0 (#2460) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.26.127 to 1.26.153 (#2452) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.77.7 to 0.77.8 (#2451) by @dependabot
  • chore(deps): bump docker/setup-buildx-action from 2.6.0 to 2.7.0 (#2450) by @dependabot
  • feat(logger): type log record in LambdaPowertoolsFormatter with TypedDict (#2419) by @erikayao93
  • chore(deps-dev): bump pytest from 7.3.1 to 7.3.2 (#2443) by @dependabot
  • chore(deps-dev): bump filelock from 3.12.0 to 3.12.2 (#2446) by @dependabot
  • chore(deps-dev): bump ijson from 3.2.0.post0 to 3.2.1 (#2441) by @dependabot
  • chore(deps-dev): bump mypy-boto3-dynamodb from 1.26.115 to 1.26.152 (#2444) by @dependabot
  • chore(deps): bump actions/checkout from 3.5.2 to 3.5.3 (#2431) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.83.0 to 2.83.1 (#2432) by @dependabot
  • docs(navigation): standardize link targets to enhance customer experience (#2420) by @leandrodamascena
  • chore(deps-dev): bump cfn-lint from 0.77.6 to 0.77.7 (#2414) by @dependabot
  • chore(deps): bump pydantic from 1.10.8 to 1.10.9 (#2405) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.25.0 to 1.25.1 (#2408) by @dependabot
  • chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.147 to 1.26.149 (#2410) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.82.0 to 2.83.0 (#2406) by @dependabot
  • chore(deps-dev): bump mypy-boto3-logs from 1.26.53 to 1.26.149 (#2409) by @dependabot
  • chore(deps): bump docker/setup-qemu-action from 2.1.0 to 2.2.0 (#2404) by @dependabot
  • chore(deps): bump docker/setup-buildx-action from 2.5.0 to 2.6.0 (#2403) by @dependabot
  • docs(maintainers): visual representation of release process (#2399) by @heitorlessa
  • chore(ci): fix PR labeling permission scope (#2396) by @heitorlessa
  • chore(ci): document all github action workflows and enforce least-privilege (#2395) by @heitorlessa

This release was made possible by the following contributors:

@abbasyadollahi, @dependabot, @dependabot[bot], @erikayao93, @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena, @ran-isenberg, @rubenfonseca and @stephenbawks

v2.16.2

06 Jun 10:04
Compare
Choose a tag to compare

Summary

This patch release primarily address a regression for custom builds that remove METADATA directory from installations, e.g., Serverless Framework with python-requirements plugin.

We have switched to bumping versions statically as of this release - SAM, CDK, Console, and Layer customers weren't affected.

Huge thanks to @bronzeson for reporting it, and @CJTurpie for reproducing it with Serverless framework plugin.

Changes

📜 Documentation updates

  • fix(parameters): AppConfigProvider when retrieving multiple unique configuration names (#2378) by @leandrodamascena

🐛 Bug and hot fixes

  • fix(shared): move to static version bumping to prevent issues with customers custom builds (#2386) by @heitorlessa
  • fix(parameters): AppConfigProvider when retrieving multiple unique configuration names (#2378) by @leandrodamascena

🔧 Maintenance

  • chore(typing): add setLevel and addHandler to Logger for mypy/pyright (#2388) by @heitorlessa
  • fix(shared): move to static version bumping to prevent issues with customers custom builds (#2386) by @heitorlessa
  • chore(deps-dev): bump mypy-boto3-cloudformation from 1.26.108 to 1.26.147 (#2383) by @dependabot
  • chore(deps-dev): bump mypy-boto3-lambda from 1.26.122 to 1.26.147 (#2382) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.24.0 to 1.25.0 (#2374) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.81.0 to 2.82.0 (#2373) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa and @leandrodamascena

v2.16.1

02 Jun 14:00
Compare
Choose a tag to compare

Summary

We packed this release with a bunch of new features and performance improvements:

  • Support for multiple CORS origins in the event handler
  • New parser support for SQS events wrapped in Kinesis Firehose
  • Huge performance improvements when using the CodePipelineJobEvent event source
  • Tons of documentation enhancements on Feature Flags and Batch Processing

⭐ Huge thanks to new contributors: @roger-zhangg and @darnley!!

Support for multiple CORS origins in the event handler

Docs: Multiple CORS origins

We added support for multiple origins in CORS when defining an event handler. Supporting multiple CORS origins enables API calls from different domains and the integration of various sources. Your existing code will continue to work as it is.

image

New parser support for SQS events wrapped in Kinesis Firehose

Docs: Kinesis Firehose SQS events

SQS event notifications can sometimes be ingested into Lambda via an intermediary such as Kinesis Firehose (i.e. Lambda event source), for various architectural reasons - batching, retries, etc. However, from the Lambda function's perspective, the intermediary might not be too important; what's important is the SQS event notification itself. Now you can easily parse and access the inner payload for Kinesis Firehose-wrapped SQS events.

image

Huge performance improvements when using the CodePipelineJobEvent event source

Thanks to @darnley, we found out that using the CodePipelineJobEvent came with a performance penalty, and we fixed it by optimizing the way we load dependencies.

Documentation enhancements on Feature Flags and Batch Processing

We've completely revamped and fine-tuned all the samples and snippets for our Feature Flags and Batch Processing utilities! We took the time to bring the examples closer to real-world usage and fixed any syntax errors. We can't wait for you to try them out!

Changes

🌟New features and non-breaking changes

📜 Documentation updates

🐛 Bug and hot fixes

  • fix(logger): remove subclassing and move unnecessary APIs (#2334) by @heitorlessa
  • fix(event_source): change the import location of boto3 in CodePipelineJobEvent data class (#2353) by @darnley

🔧 Maintenance

  • chore(deps-dev): bump cfn-lint from 0.77.5 to 0.77.6 (#2360) by @dependabot
  • feat(user-agent): add custom header User-Agent to AWS SDK requests (#2267) by @roger-zhangg
  • chore(deps): bump aws-actions/configure-aws-credentials from 2.0.0 to 2.1.0 (#2350) by @dependabot
  • chore(deps): bump typing-extensions from 4.5.0 to 4.6.2 (#2345) by @dependabot
  • docs(project): rename project to Powertools for AWS Lambda (Python) (#2313) by @sthulb
  • chore(deps-dev): bump types-requests from 2.31.0.0 to 2.31.0.1 (#2339) by @dependabot
  • chore(deps-dev): bump coverage from 7.2.6 to 7.2.7 (#2338) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.14 to 9.1.15 (#2337) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.80.0 to 2.81.0 (#2332) by @dependabot
  • chore(deps-dev): bump coverage from 7.2.5 to 7.2.6 (#2326) by @dependabot
  • chore(deps-dev): bump pytest-cov from 4.0.0 to 4.1.0 (#2327) by @dependabot
  • chore(deps): bump actions/setup-python from 4.6.0 to 4.6.1 (#2325) by @dependabot
  • chore(deps-dev): bump types-requests from 2.30.0.0 to 2.31.0.0 (#2315) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.23.1 to 1.24.0 (#2314) by @dependabot
  • chore(deps): bump pydantic from 1.10.7 to 1.10.8 (#2316) by @dependabot
  • chore(ci): source code tampering protection for release (#2301) by @heitorlessa
  • chore(deps): bump requests from 2.28.2 to 2.31.0 (#2308) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.79.1 to 2.80.0 (#2305) by @dependabot
  • chore(deps): bump fastjsonschema from 2.16.3 to 2.17.1 (#2307) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.13 to 9.1.14 (#2304) by @dependabot
  • chore(deps-dev): bump httpx from 0.24.0 to 0.24.1 (#2298) by @dependabot
  • chore(deps-dev): bump pytest-xdist from 3.3.0 to 3.3.1 (#2297) by @dependabot
  • chore(deps-dev): bump mypy-boto3-secretsmanager from 1.26.116 to 1.26.135 (#2282) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.23.0 to 1.23.1 (#2283) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.12 to 9.1.13 (#2280) by @dependabot
  • chore(governance): Fix python version in issue templates (#2275) by @leandrodamascena
  • chore(deps): update mkdocs configuration to support pymdown-extensions 10.0 (#2271) by @leandrodamascena
  • chore(deps): bump pymdown-extensions from 9.11 to 10.0 (#2262) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.22.2 to 1.23.0 (#2264) by @dependabot
  • chore(deps): bump codecov/codecov-action from 3.1.3 to 3.1.4 (#2263) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.11 to 9.1.12 (#2253) by @dependabot
  • chore(deps-dev): bump pytest-xdist from 3.2.1 to 3.3.0 (#2251) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.79.0 to 2.79.1 (#2252) by @dependabot
  • chore(ci): update layer ARN docs and create PR during release (#2240) by @heitorlessa
  • chore(ci): bump package version after release via pull request (#2239) by @heitorlessa
  • chore(ci): convert create-pr steps into composite action (#2238) by @heitorlessa
  • chore(ci): changelog rebuild (#2241) by @github-actions
  • chore(deps-dev): bump aws-cdk from 2.78.0 to 2.79.0 (#2235) by @dependabot
  • docs(batch_processing): snippets split, improved, and lint (#2231) by @rubenfonseca
  • chore(deps-dev): bump mypy from 1.2.0 to 1.3.0 (#2233) by @dependabot
  • chore(deps-dev): bump types-python-dateutil from 2.8.19.12 to 2.8.19.13 (#2234) by @dependabot
  • chore(deps-dev): bump mkdocs-material from 9.1.9 to 9.1.11 (#2229) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.77.4 to 0.77.5 (#2228) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.2 to 2.1.3 (#2227) by @dependabot
  • chore(ci): skip analytics on forks (#2225) by @heitorlessa
  • chore(ci): create pull request on changelog update (#2224) by @heitorlessa
  • chore(deps-dev): bump mypy-boto3-cloudwatch from 1.26.99 to 1.26.127 (#2219) by @dependabot
  • chore(deps-dev): bump types-requests from 2.29.0.0 to 2.30.0.0 (#2220) by @dependabot
  • chore(deps-dev): bump mypy-boto3-s3 from 1.26.116 to 1.26.127 (#2218) by @dependabot
  • chore(ci): schedule changelog to rebuild daily at 8am, and on release only (#2216) by @heitorlessa
  • chore(ci): remove auto-merge workflow (#2214) by @heitorlessa
  • chore(ci): enforce zero trust for third party workflows (#2215) by @heitorlessa
  • chore(deps-dev): bump aws-cdk from 2.77.0 to 2.78.0 (#2202) by @dependabot

This release was made possible by the following contributors:

@darnley, @dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena, @roger-zhangg, @rubenfonseca, @sthulb and Release bot

v2.15.0

04 May 16:34
Compare
Choose a tag to compare

Summary

This release is packed with a number of improvements:

  • New external provider formats in Logger
  • New Parser models and JMESPath expressions to naturally process S3 Event Notifications targets
  • Printing Event Source Data Classes now automatically mask sensitive data
  • New flush_metrics in Metrics to support customers using Lambda Web Adapter
  • Added support for the China and GovCloud regions in API Gateway Authorizer event (bugfix)

And… a ton of documentation improvements.

⭐ Huge thanks to new contributors: @theipster (S3 events), @neilramsay (Data Class debug), @arjanschaaf (Batch docs) and @leif-ye (API Gateway Event Source)

External provider formats in the Logger utility

Docs: Observability providers

You can now send logs to the observability provider of your choice via Lambda Extensions. In most cases, you shouldn't need any custom Logger configuration, and logs will be shipped asynchronously with no performance impact.
image

Improved S3 Event Notifications developer experience

Docs: Built-in envelopes, Parser

S3 event notifications can be sometimes be ingested into Lambda via an intermediary such as an SQS queue (i.e. Lambda event source), for various architectural reasons - batching, retries, etc. However, from the Lambda function's perspective, the intermediary might not be too important; what's important is the S3 event notification itself. Now you can easily parse and access the inner payload for SQS-wrapper S3 events.

JMESPath

carbon (2)

Parser

carbon (3)

Printing Event Source Data Classes

Docs: Debugging

You can now print out the fields of a data class instance to obtain more information. All classes come with a __str__ method that generates a dictionary string which can be quite useful for debugging. Sensitive fields such as secret_access_key and session_token, are labeled as [SENSITIVE], to prevent any accidental disclosure of confidential information.

carbon (4)

Flushing metrics manually

Docs: Flushing metrics manually

You can now manually flush the metrics at any time. This is useful when not running within a standard Lambda handler (e.g: Lambda Web Adapter), where the @log_metrics decorator does not work as intended.

image

Changes

🌟New features and non-breaking changes

  • feat(event_source): support custom json_deserializer; add json_body in SQSEvent (#2200) by @leandrodamascena
  • feat(parser): add support for SQS-wrapped S3 event notifications (#2108) by @theipster
  • feat(logger): add DatadogLogFormatter and observability provider (#2183) by @heitorlessa
  • feat(jmespath): new built-in envelopes to unwrap S3 events (#2169) by @leandrodamascena
  • feat(event_source): add support for dynamic partitions in the Api Gateway Authorizer event (#2176) by @leif-ye
  • feat(metrics): add flush_metrics() method to allow manual flushing of metrics (#2171) by @rubenfonseca
  • feat(event_sources): Add str to Data Classes base DictWrapper (#2129) by @neilramsay
  • feat(ci): dispatch GitHub analytics action (#2161) by @rubenfonseca

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

@arjanschaaf, @dependabot, @dependabot[bot], @heitorlessa, @leandrodamascena, @leif-ye, @neilramsay, @rubenfonseca, @theipster and Release bot

v2.14.1

21 Apr 13:30
Compare
Choose a tag to compare

Summary

This patch release addresses a regression in Batch for anyone not using Pydantic or installing Powertools via Layers.

Huge thanks to @walmsles ⭐ for spotting it and sending a fix in record time.

Changes

🌟New features and non-breaking changes

🐛 Bug and hot fixes

🔧 Maintenance

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @heitorlessa, @leandrodamascena, @rubenfonseca, @walmsles and Release bot