Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 28, 2025

Bumps aws-lambda-powertools from 2.35.1 to 3.11.0.

Release notes

Sourced from aws-lambda-powertools's releases.

v3.11.0

Summary

We are excited to announce a new integration for Event Handler to work with AWS AppSync Events APIs. This utility provides a structured way to handle AppSync real-time events through dedicated handler methods, automatic routing, and flexible configuration options.

Our Event Handler REST API now supports customizable HTTP error codes per route. Thanks for this contribution @​amin-farjadi.

Additionally, our Data masking utility now supports a broader range of types including Pydantic models, dataclasses, and standard Python classes - an outstanding contribution from @​VatsalGoel3.

⭐ Huge thanks to @​GuidoNebiolo, @​kazu728, @​victorperezpiqueras, and @​konokenj for their contributions in this release.

New Event Handler for AppSync Events feature

Docs

The new AppSyncEventsResolver is designed to streamline working with AWS AppSync real-time APIs by:

  • Handling publish and subscribe events with dedicated handler methods
  • Routing events automatically based on namespace and channel patterns
  • Supporting wildcard patterns for catch-all handlers
  • Processing events in parallel (async) or sequentially
  • Controlling event aggregation for batch processing
  • Implementing graceful error handling

Working with publish events

You can register handlers for publish events using @app.on_publish() to process and validate messages before they're broadcasted to subscribers. This is useful to modify payload content, apply business logic, and reject messages when needed.

publish

Working with subscribe events

You can use @app.on_subscribe() to handle subscription requests before allowing clients to listen to specific channels. This enables authorization checks and subscription filtering based on client context or payload attributes, s well as subscription tracking, for example.

subscribe

Working with aggregated processing

You can use the parameter aggregate=True to process multiple events together as a batch. This is useful when you need to optimize database operations, or want to have full control over how the messages are processed, for example.

aggregate

AppSync Events FAQs

Q: Can I handle different types of events from the same channel? A: Yes, you can register different handlers for publish and subscribe events on the same channel.

Q: How does handler precedence work with wildcard patterns?

... (truncated)

Changelog

Sourced from aws-lambda-powertools's changelog.

[v3.11.0] - 2025-04-24

Bug Fixes

  • logger: warn customers when the ALC log level is less verbose than log buffer (#6509)
  • parser: make key attribute optional in Kafka model (#6523)

Code Refactoring

  • batch: use standard collections for types (#6475)
  • data_masking: use standard collections for types (#6493)
  • e2e-tests: use standard collections for types + refactor code (#6505)
  • event_handler: use standard collections for types + refactor code (#6495)
  • event_source: use standard collections for types (#6479)
  • feature_flags: use standard collections for type (#6489)
  • general: add support for ruff format (#6512)
  • idempotency: use standard collections for types (#6487)
  • logger: use standard collections for types (#6471)
  • metrics: use standard collections for types (#6472)
  • middleware_factory: use standard collections for types (#6485)
  • parameters: use standard collections for types (#6481)
  • streaming: use standard collections for types (#6483)
  • tests: use standard collections for types + refactor code (#6497)
  • tracer: use standard collections for types (#6473)
  • validation: use standard collections for types (#6491)

Documentation

  • bedrock: fix BedrockServiceRole in template.yaml (#6436)
  • bedrock_agents: remove Pydantic v1 recommendation (#6468)
  • event_handler: add docs for AppSync event resolver (#6557)
  • event_handler: fix typo in api keys swagger url (#6536)

Features

  • bedrock: add openapi_extensions in BedrockAgentResolver (#6510)
  • data-masking: add support for Pydantic models, dataclasses, and standard classes (#6413)
  • event_handler: add AppSync events resolver (#6558)
  • event_handler: add extras HTTP Error Code Exceptions (#6454)
  • event_handler: add route-level custom response validation in OpenAPI utility (#6341)
  • logger: add support for exception notes (#6465)

Maintenance

  • version bump
  • ci: new pre-release 3.10.1a7 (#6518)
  • ci: new pre-release 3.10.1a0 (#6431)
  • ci: new pre-release 3.10.1a1 (#6437)
  • ci: new pre-release 3.10.1a2 (#6446)
  • ci: new pre-release 3.10.1a10 (#6538)
  • ci: new pre-release 3.10.1a3 (#6455)

... (truncated)

Upgrade guide

Sourced from aws-lambda-powertools's upgrade guide.


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

End of support v2

!!! warning "On March 25st, 2025, Powertools for AWS Lambda (Python) v2 reached end of support and will no longer receive updates or releases. If you are still using v2, we strongly recommend you to read our upgrade guide and update to the latest version."

Given our commitment to all of our customers using Powertools for AWS Lambda (Python), we will keep Pypi{target="_blank"} v2 releases and documentation 2.x versions to prevent any disruption.

Migrate to v3 from v2

!!! info "We strongly encourage you to migrate to v3. However, if you still need to upgrade from v1 to v2, you can find the upgrade guide."

We've made minimal breaking changes to make your transition to v3 as smooth as possible.

Quick summary

Area Change Code change required
Pydantic We have removed support for Pydantic v1 No
Parser We have replaced DynamoDBStreamModel AttributeValue with native Python types Yes
Parser We no longer export Pydantic objects from parser.pydantic. Yes
Lambda layer Lambda layers are now compiled according to the specific Python version and architecture No
Event Handler We have deprecated the get_header_value function. Yes
Batch Processor @batch_processor and @async_batch_processor decorators are now deprecated Yes
Event Source Data Classes We have updated default values for optional fields. Yes
Parameters The default cache TTL is now set to 5 minutes No
Parameters The config parameter is deprecated in favor of boto_config Yes
JMESPath Functions The extract_data_from_envelope function is deprecated in favor of query Yes
Types file We have removed the type imports from the shared/types.py file Yes

First Steps

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

  1. Upgrade Python to at least v3.9.
  2. Ensure you have the latest version via Lambda Layer or PyPi{target="_blank"}.
  3. Review the following sections to confirm if you need to make changes to your code.

Drop support for Pydantic v1

!!! note "No code changes required"

As of June 30, 2024, Pydantic v1 has reached its end-of-life, and we have discontinued support for this version. We now exclusively support Pydantic v2.

Use Pydantic v2 Migration Guide{target="_blank"} to migrate your custom Pydantic models to v2.

... (truncated)

Commits
  • 7bc3b06 chore: version bump
  • 970d97e feat(event_handler): add AppSync events resolver (#6558)
  • 0939463 chore(deps-dev): bump sentry-sdk from 2.26.1 to 2.27.0 (#6553)
  • abb2069 chore(deps-dev): bump ruff from 0.11.6 to 0.11.7 (#6555)
  • 24098e1 chore(deps-dev): bump boto3-stubs from 1.38.1 to 1.38.2 (#6556)
  • 2e26856 chore(deps-dev): bump httpx from 0.25.1 to 0.28.1 (#6554)
  • a1bd8bf docs(event_handler): add docs for AppSync event resolver (#6557)
  • 6a0282a chore(deps): bump actions/download-artifact from 4.2.1 to 4.3.0 (#6550)
  • 8051854 chore(deps): bump actions/setup-python from 5.5.0 to 5.6.0 (#6549)
  • 2532d70 chore(deps-dev): bump h11 from 0.14.0 to 0.16.0 (#6548)
  • Additional commits viewable in compare view

Dependabot compatibility score

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


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

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

Bumps [aws-lambda-powertools](https://github.com/aws-powertools/powertools-lambda-python) from 2.35.1 to 3.11.0.
- [Release notes](https://github.com/aws-powertools/powertools-lambda-python/releases)
- [Changelog](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CHANGELOG.md)
- [Upgrade guide](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/docs/upgrade.md)
- [Commits](aws-powertools/powertools-lambda-python@v2.35.1...v3.11.0)

---
updated-dependencies:
- dependency-name: aws-lambda-powertools
  dependency-version: 3.11.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Apr 28, 2025
@sonarqubecloud
Copy link

@github-actions
Copy link

💥 Something went wrong while building the pull request environment.
Check Output Logs

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github May 26, 2025

Superseded by #912.

@dependabot dependabot bot closed this May 26, 2025
@dependabot dependabot bot deleted the dependabot/pip/aws-lambda-powertools-3.11.0 branch May 26, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants