NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #975 most downloaded on PyPI
Powertools for AWS Lambda (Python) is a developer toolkit to implement Serverless best practices and increase developer velocity.
Last release 19 days ago
15 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 58 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
7 years old
530 releases · first in 2019
Nothing published for this version
In this release we fixed a problem when deserializing protobuf records with complex schemas.
In this release we fixed a problem when deserializing protobuf records with complex schemas.
@leandrodamascena
Nothing published for this version
One column per quarter.
We're excited to announce the Kafka Consumer utility, which transparently handles message deserialization, provides an intuitive developer experience,
We're excited to announce the Kafka Consumer utility, which transparently handles message deserialization, provides an intuitive developer experience, and integrates seamlessly with the rest of the Powertools for AWS Lambda ecosystem.
To get started, depending on the schema types you want to use, install the library and the corresponding libraries:
For JSON schemas:
pip install aws-lambda-powertools
For Avro schemas:
pip install 'aws-lambda-powertools[kafka-consumer-avro]'
For Protobuf schemas:
pip install 'aws-lambda-powertools[kafka-consumer-protobuf]'
Additionally, if you want to use output serialization with Pydantic Models or Dataclases
You can use Kafka consumer utility to transform raw Kafka events into an intuitive format for processing.
The @kafka_consumer decorator can deserialize both keys and values independently based on your schema configuration. This flexibility allows you to work with different data formats in the same message.
Working with Avro
Working with Protobuf
Working with JSON
You can transform deserialized data into your preferred object types using output serializers. This can help you integrate Kafka data with your domain models and application architecture, providing type hints, validation, and structured data access.
You can handle errors when processing Kafka messages to ensure your application maintains resilience and provides clear diagnostic information.
We lazily decode fields like value, key, and headers only when accessed. This allows you to handle deserialization errors at the point of access rather than when the record is first processed.
@dependabot[bot], @github-actions[bot], @leandrodamascena, @matteofigus, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release introduces a new BedrockAgentFunctionResolver to Event Handler that simplifies connecting AWS Lambda functions to Amazon Bedrock Agents.
This release introduces a new BedrockAgentFunctionResolver to Event Handler that simplifies connecting AWS Lambda functions to Amazon Bedrock Agents. This feature eliminates the need to write boilerplate code for parsing requests and formatting responses, allowing you to focus on your agent's business logic.
We would also like to extend a huge thank you to our new contributor @LucasCMFBraga ⭐
You can now use the new BedrockAgentFunctionResolver to register tools and handle requests in your Lambda functions. The resolver will automatically parse the request, route it to the appropriate function, and return a well-formed response that includes the tool's output and any existing session attributes.
By default, errors are handled gracefully and returned to the agent with error type and message information, allowing the conversation to continue. This is useful when you want to let the LLM handle errors and reduce boilerplate error-handling code.
If you need more control over error scenarios, you can use BedrockFunctionResponse to customize the response and determine if the conversation should continue:
You can also use the BedrockFunctionResponse when you want to enrich the response with session attributes or knowledge base configurations, or when you want the agent to re-prompt the user to provide additional information.
@LucasCMFBraga, @anafalcao, @dependabot[bot], @github-actions[bot], @hjgraca, @leandrodamascena, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
For backward compatibility, we've maintained the old Redis class names. However, these are now marked as deprecated and will be removed in the next ma…
In this release, we renamed the Redis class to Cache in our Idempotency utility and added support for the valkey-glide library.
Thanks to our new contributors @AlisonVilela, @Artur-T-Malas, and @kiitosu, we also fixed bugs in our Event Source Data Class utility. ⭐🏅
CachePersistenceLayer classYou can now use our CachePersistenceLayer classes, which are more generically named, in place of the previous Redis-specific classes when using the Idempotency feature.
For backward compatibility, we've maintained the old Redis class names. However, these are now marked as deprecated and will be removed in the next major version.
We've also added support for valkey-glide, providing more flexibility for your caching implementation needs.
If you are using the RedisPersistenceLayer class in your codebase, you can use the new CachePersistenceLayer as a drop-in replacement.
f6c81d5 to eb04b60 in /docs (#6659) by @dependabot[bot]95f2ff4 to f6c81d5 in /docs (#6650) by @dependabot[bot]@AlisonVilela, @Artur-T-Malas, @dependabot[bot], @github-actions[bot], @kiitosu, @leandrodamascena, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Thanks to @anafalcao, in this release we added support for additional response fields supported by Bedrock Agents when using the BedrockAgentResolver.
Thanks to @anafalcao, in this release we added support for additional response fields supported by Bedrock Agents when using the BedrockAgentResolver.
You can use the BedrockResponse class to add additional fields as needed, such as session attributes, prompt session attributes, and knowledge base configurations. These fields are useful when you want to persist attributes across multiple sessions, for example
@anafalcao, @dependabot[bot], @dreamorosi, @github-actions[bot], @leandrodamascena, @ran-isenberg, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
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
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.
The new AppSyncEventsResolver is designed to streamline working with AWS AppSync real-time APIs by:
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.
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.
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.
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?
A: More specific patterns take precedence over wildcards. For example, /default/channel1 will be chosen over /default/*, which will be chosen over /*.
Q: What happens when an exception occurs in my handler?
A: With individual processing (aggregate=False), the utility catches exceptions and includes them in the response for the specific event while still processing other events. You can also explicitly raise an UnauthorizedException exception to reject the entire request.
Q: Can I process events asynchronously?
A: Yes, use the @app.async_on_publish() decorator for asynchronous processing of events.
Q: Does the order of async event processing matter? A: No, AppSync Events doesn't guarantee delivery order. As long as each response includes the original event ID, AppSync processes them correctly regardless of order.
Q: Can I process multiple events as a batch?
A: Yes, set aggregate=True to receive all matching events as a batch in your handler.
ruff format (#6512) by @leandrodamascenaopenapi_extensions in BedrockAgentResolver (#6510) by @leandrodamascena@GuidoNebiolo, @VatsalGoel3, @Weugene, @amin-farjadi, @anafalcao, @dependabot[bot], @github-actions[bot], @kazu728, @konokenj, @leandrodamascena, @victorperezpiqueras, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release introduces a new built-in model AppSyncResolverEventModel for the Parser utility, enabling structured parsing and validation of AWS AppSy
This release introduces a new built-in model AppSyncResolverEventModel for the Parser utility, enabling structured parsing and validation of AWS AppSync Resolver events using Pydantic.
It also improves the developer experience when logging with exc_info=True by updating the logic to check if an actual exception exists before adding exception-related keys to the log.
Fixes missing properties for query string parameters in APIGatewayWebSocketEvent class, and the return type of a parameter in TransferFamilyAuthorizerResponse.
⭐ Huge thanks to @VatsalGoel3, @dave-dotnet-overall and @fabien-github!
Enables structured parsing and validation of AWS AppSync Resolver events using Pydantic. The schema supports fields such as arguments, identity, source, request, info, prev, and stash, covering all standard AppSync resolver context attributes.
exc_info=True to prevent errors (#6417) by @leandrodamascena3555052 to 23b6978 in /docs (#6404) by @dependabot[bot]f226a2d to 3555052 in /docs (#6372) by @dependabot[bot]@VatsalGoel3, @dave-dotnet-overall, @dependabot[bot], @fabien-github, @github-actions[bot], @leandrodamascena, dependabot[bot] and github-actions[bot]
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →