pypi aws-lambda-powertools 2.29.0
v2.29.0

latest releases: 3.2.1a13, 3.2.1a12, 3.2.1a11...
11 months ago

Summary

Standardized Retrieval of API Gateway Authorizer Context

This release standardizes how to retrieve the API Gateway authorizer context in both v1 and v2 of the Lambda handler. Previously, there were inconsistencies in how customers retrieved authorization context between V1 and V2 payloads.

from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools import Logger

app = APIGatewayRestResolver()
logger = Logger(level="INFO")


@app.get("/")
def initialize():
    context: dict = app.current_event.request_context.authorizer.get_context()
    logger.info(context.get("tenantId"))

def lambda_handler(event, context):
    return app.resolve(event, context)

We also fixed an issue with dependency injection when using decorators in the Lambda handler function. Previously, dependencies were not properly injected when decorators were present, leading to runtime errors.

Changes

  • fix(metrics): lambda_handler typing, and **kwargs preservation all middlewares (#3460) by @heitorlessa
  • feat(event_sources): add get_context() to standardize API Gateway Lambda Authorizer context in v1 and v2 (#3454) by @leandrodamascena
  • chore(layers): Update log retention to 10 years (#3424) by @sthulb

📜 Documentation updates

  • chore(deps): bump squidfunk/mkdocs-material from fc42bac to 8c72011 in /docs (#3416) by @dependabot

🔧 Maintenance

  • chore(deps): bump actions/setup-python from 4.8.0 to 5.0.0 (#3465) by @dependabot
  • chore(deps): bump datadog-lambda from 5.84.0 to 5.85.0 (#3466) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.113.0 to 2.114.1 (#3464) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3467) by @dependabot
  • fix(event_handler): serialize pydantic/dataclasses in exception handler (#3455) by @heitorlessa
  • chore(deps-dev): bump the boto-typing group with 1 update (#3457) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.6 to 0.1.7 (#3458) by @dependabot
  • chore(deps): bump actions/setup-python from 4.7.1 to 4.8.0 (#3456) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.83.3 to 0.83.4 (#3450) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.1 to 3.0.2 (#3449) by @dependabot
  • chore(deps): bump datadog-lambda from 5.83.0 to 5.84.0 (#3438) by @dependabot
  • chore(deps): bump cryptography from 41.0.4 to 41.0.6 (#3431) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.112.0 to 2.113.0 (#3448) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.36.0 to 1.38.0 (#3435) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.111.0 to 2.112.0 (#3440) by @dependabot
  • chore(deps): bump pypa/gh-action-pypi-publish from 1.8.10 to 1.8.11 (#3433) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3441) by @dependabot
  • chore(deps): bump actions/dependency-review-action from 3.1.3 to 3.1.4 (#3426) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.110.1 to 2.111.0 (#3428) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from fc42bac to 8c72011 in /docs (#3416) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.110.1 to 2.111.0 (#3418) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 11 updates (#3427) by @dependabot

This release was made possible by the following contributors:

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

Don't miss a new aws-lambda-powertools release

NewReleases is sending notifications on new releases.