Summary
This release introduces per-route validation support in event handler, durable context support for logger and metric decorators, multiple dimension sets in metrics, S3 IntelligentTiering event support, and a URL-decode flag for ALB query parameters. We also shipped several important bug fixes across logger, parameters, event handler, and typing.
A huge thanks to @oyiz-michael, @chriselion, @maxrabin, @facu-01, and @Iamrodos, for their contributions ππ
Per-route validation support
You can now enable or disable validation on individual routes. This is useful when migrating incrementally - enable validation globally and opt-out specific legacy routes, or vice versa.
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from pydantic import BaseModel
app = APIGatewayRestResolver(enable_validation=True)
class Todo(BaseModel):
title: str
completed: bool
# This route has validation enabled (inherits from resolver)
@app.post("/todos")
def create_todo(todo: Todo) -> dict:
return {"title": todo.title}
# This route opts out of validation
@app.get("/legacy", enable_validation=False)
def legacy_endpoint():
return {"message": "no validation here"}Durable Context support in Logger and Metrics decorators
Logger and Metrics decorators now handle AWS Lambda Durable Context automatically. When a durable function replays, the decorators unwrap the DurableContext to access the underlying Lambda context - no changes needed in your code.
from aws_lambda_powertools import Logger, Metrics
from aws_lambda_powertools.metrics import MetricUnit
logger = Logger()
metrics = Metrics()
@logger.inject_lambda_context # automatically handles DurableContext
@metrics.log_metrics # automatically handles DurableContext
def lambda_handler(event, context):
logger.info("Processing event")
metrics.add_metric(name="InvocationCount", unit=MetricUnit.Count, value=1)
return {"statusCode": 200}Multiple dimension sets in Metrics
You can now publish metrics with multiple dimension sets using add_dimensions(). Each call creates a new dimension set in the CloudWatch EMF output.
from aws_lambda_powertools import Metrics
from aws_lambda_powertools.metrics import MetricUnit
metrics = Metrics()
@metrics.log_metrics
def lambda_handler(event, context):
metrics.add_metric(name="OrderCount", unit=MetricUnit.Count, value=1)
# Each call creates a separate dimension set
metrics.add_dimensions(environment="prod", region="us-east-1")
metrics.add_dimensions(service="orders", team="backend")ALB URL-decode query parameters
A new decode_query_parameters flag in ALBResolver automatically URL-decodes query parameter keys and values.
from aws_lambda_powertools.event_handler import ALBResolver
app = ALBResolver(decode_query_parameters=True)
@app.get("/search")
def search():
# Query params are automatically URL-decoded
query = app.current_event.query_string_parameters
return {"query": query}Changes
- fix(ci): remove DUB region (#8031) by @leandrodamascena
- fix(event_handler): add middleware validation per route (#8020) by @leandrodamascena
- chore: remove unused PR automation workflows (#8008) by @dreamorosi
- feat(event-handler): add per-route validation support (#7965) by @oyiz-michael
- feat(event_source): add support for S3 IntelligentTiering events (#7954) by @oyiz-michael
- feat: Add a flag to ALBResolver to URL-decode query parameters (#7940) by @chriselion
- refactor(batch): improve type annotation for event parameter (#7924) by @maxrabin
πNew features and non-breaking changes
- feat: add HttpResolverAlpha resolver (#7913) by @leandrodamascena
- feat(openapi): add support for micro Lambda pattern (#7920) by @leandrodamascena
- feat(decorators): Support Durable Context in logger and metric decorators (#7765) by @ConnorKirk
- feat(metrics): add support for multiple dimension sets (#7848) by @oyiz-michael
π Documentation updates
- chore(deps): bump squidfunk/mkdocs-material from
3bba0a9to8f41b60in /docs (#8010) by @dependabot[bot] - docs: clarify append_context_keys behavior with overlapping keys (#7846) by @oyiz-michael
π Bug and hot fixes
- fix(logger): preserve percent-style formatting args in flush_buffer (#8009) by @dreamorosi
- fix(parameters): fix variable shadowing in SSM parameter chunking (#8006) by @dreamorosi
- fix(event_handler): return 415 status_code for unsupported content-type headers (#7980) by @chriselion
- fix(typing): resolve ty diagnostics in logging and metrics modules (#7953) by @ConnorKirk
- fix(event-handler): prevent OpenAPI schema bleed when reusing response dictionaries (#7952) by @oyiz-michael
- fix(event_handler): sync alias and validation_alias for Pydantic 2.12+ compatibility (#7901) by @leandrodamascena
- fix(typing): accept Mapping type in resolve() for event parameter (#7909) by @Iamrodos
- fix(event_handler): fix bug regression in Annotated field (#7904) by @leandrodamascena
- fix(event_handler): preserve openapi_examples on Body (#7862) by @facu-01
π§ Maintenance
- chore(deps): bump valkey-glide from 2.2.5 to 2.2.7 (#8030) by @dependabot[bot]
- chore(deps): bump aws-encryption-sdk from 4.0.3 to 4.0.4 (#8027) by @dependabot[bot]
- chore(deps-dev): bump types-python-dateutil from 2.9.0.20260124 to 2.9.0.20260305 (#8029) by @dependabot[bot]
- chore(deps-dev): bump ijson from 3.4.0.post0 to 3.5.0 (#8028) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1108.0 to 2.1110.0 in the aws-cdk group (#8023) by @dependabot[bot]
- chore(deps-dev): bump filelock from 3.24.2 to 3.25.0 (#8016) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1106.0 to 2.1108.0 in the aws-cdk group (#8011) by @dependabot[bot]
- chore(deps): bump datadog-lambda from 8.120.0 to 8.121.0 (#8015) by @dependabot[bot]
- chore(deps): bump the github-actions group with 4 updates (#8013) by @dependabot[bot]
- chore(deps-dev): bump cfn-lint from 1.44.0 to 1.46.0 (#8018) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
3bba0a9to8f41b60in /docs (#8010) by @dependabot[bot] - chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.233.0a0 to 2.238.0a0 (#7997) by @dependabot[bot]
- chore(deps-dev): bump types-python-dateutil from 2.9.0.20251115 to 2.9.0.20260124 (#7989) by @dependabot[bot]
- chore(deps-dev): bump sentry-sdk from 2.52.0 to 2.53.0 (#7998) by @dependabot[bot]
- chore(deps-dev): bump filelock from 3.20.3 to 3.24.2 (#7999) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1105.0 to 2.1106.0 in the aws-cdk group (#7995) by @dependabot[bot]
- chore(deps): bump actions/dependency-review-action from 4.8.2 to 4.8.3 in the github-actions group (#8004) by @dependabot[bot]
- chore(deps): bump cryptography from 46.0.3 to 46.0.5 (#7991) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-lib from 2.237.1 to 2.238.0 (#7986) by @dependabot[bot]
- chore(deps-dev): bump testcontainers from 4.14.0 to 4.14.1 (#7988) by @dependabot[bot]
- chore(deps-dev): bump sentry-sdk from 2.48.0 to 2.52.0 (#7987) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1103.0 to 2.1105.0 in the aws-cdk group (#7982) by @dependabot[bot]
- chore(deps): bump the github-actions group with 2 updates (#7985) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-lib from 2.233.0 to 2.236.0 (#7974) by @dependabot[bot]
- chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.312 to 0.1.314 (#7973) by @dependabot[bot]
- chore(deps-dev): bump cfn-lint from 1.43.3 to 1.43.4 (#7972) by @dependabot[bot]
- chore(deps): bump jmespath from 1.0.1 to 1.1.0 (#7970) by @dependabot[bot]
- chore(deps): bump the github-actions group with 3 updates (#7971) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1101.0 to 2.1103.0 in the aws-cdk group (#7967) by @dependabot[bot]
- chore(deps-dev): bump the dev-dependencies group with 2 updates (#7969) by @dependabot[bot]
- chore(deps): bump protobuf from 6.33.4 to 6.33.5 (#7977) by @dependabot[bot]
- chore(deps-dev): bump cfn-lint from 1.43.2 to 1.43.3 (#7958) by @dependabot[bot]
- chore(deps-dev): bump testcontainers from 4.13.3 to 4.14.0 (#7959) by @dependabot[bot]
- chore(deps-dev): bump multiprocess from 0.70.18 to 0.70.19 (#7961) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1100.3 to 2.1101.0 in the aws-cdk group (#7955) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.14.11 to 0.14.13 in the dev-dependencies group (#7957) by @dependabot[bot]
- chore(deps-dev): bump bandit from 1.9.2 to 1.9.3 (#7962) by @dependabot[bot]
- chore(deps): bump the github-actions group with 3 updates (#7960) by @dependabot[bot]
- chore(deps-dev): bump virtualenv from 20.35.4 to 20.36.1 (#7950) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1100.2 to 2.1100.3 in the aws-cdk group (#7942) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.42.21 to 1.42.26 (#7945) by @dependabot[bot]
- chore(deps): bump valkey-glide from 2.2.3 to 2.2.5 (#7947) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.14.10 to 0.14.11 in the dev-dependencies group (#7944) by @dependabot[bot]
- chore(deps-dev): bump filelock from 3.20.2 to 3.20.3 (#7946) by @dependabot[bot]
- chore(deps): bump protobuf from 6.33.2 to 6.33.4 (#7948) by @dependabot[bot]
- chore(typing): add ty type checker to CI with baseline exclusions (#7938) by @ConnorKirk
- chore(deps-dev): bump urllib3 from 2.6.2 to 2.6.3 in /layer_v3 (#7928) by @dependabot[bot]
- chore(deps): bump urllib3 from 2.6.0 to 2.6.3 in /docs (#7921) by @dependabot[bot]
- chore(deps-dev): bump urllib3 from 2.6.2 to 2.6.3 (#7922) by @dependabot[bot]
- chore: update swagger ui files (#7914) by @leandrodamascena
- chore(deps-dev): bump cfn-lint from 1.43.1 to 1.43.2 (#7907) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1100.1 to 2.1100.2 in the aws-cdk group (#7905) by @dependabot[bot]
- chore: adding fuzzing tests (#7903) by @leandrodamascena
This release was made possible by the following contributors:
@ConnorKirk, @Iamrodos, @chriselion, @dependabot[bot], @dreamorosi, @facu-01, @github-actions[bot], @leandrodamascena, @maxrabin, @oyiz-michael, dependabot[bot] and github-actions[bot]