Skip to content

Releases: aws-powertools/powertools-lambda-python

v2.30.1

15 Dec 14:31
Compare
Choose a tag to compare

Summary

This patch release fixes a bug when using the event handler Router together with OpenAPI metadata.

Huge thanks to @MCR2019 for finding and reporting this out!

Changes

  • fix(event_handler): allow responses and metadata when using Router (#3514) by @rubenfonseca

🔧 Maintenance

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot] and @rubenfonseca

v2.30.0

14 Dec 21:52
Compare
Choose a tag to compare

Summary

This release follows the newly announced Python 3.12 runtime in AWS Lambda 🚀

Changes

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

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

v2.29.1

12 Dec 11:52
Compare
Choose a tag to compare

Summary

This patch release fixes a bug in the Logger utility, ensuring it prints non-ASCII values as-is instead of escaping them. Previously, non-ASCII characters were displayed in an encoded format.

Huge thanks to @bml1g12 for reporting this! ⭐

Changes

  • fix(logger): log non-ascii characters as is when JSON stringifying (#3475) by @heitorlessa

📜 Documentation updates

  • chore(deps): bump squidfunk/mkdocs-material from 876b39c to 9af3b7e in /docs (#3486) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 20241c6 to 876b39c in /docs (#3477) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 8c72011 to 20241c6 in /docs (#3470) by @dependabot

🔧 Maintenance

  • chore(deps-dev): bump cfn-lint from 0.83.4 to 0.83.5 (#3487) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 876b39c to 9af3b7e in /docs (#3486) by @dependabot
  • chore(tests): temporarily disable E2E parallelism (#3484) by @heitorlessa
  • chore(deps-dev): bump the boto-typing group with 1 update (#3478) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 20241c6 to 876b39c in /docs (#3477) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3476) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 8c72011 to 20241c6 in /docs (#3470) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3469) by @dependabot
  • 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

This release was made possible by the following contributors:

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

v2.29.0

07 Dec 15:41
Compare
Choose a tag to compare

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

v2.28.1

28 Nov 00:47
Compare
Choose a tag to compare

Summary

This patch release fixes a bug on the event handler utility, where using the compress option was causing an error.

Huge thanks to @dacianf for reporting this!

Changes

This release was made possible by the following contributors:

@github-actions, @github-actions[bot] and @rubenfonseca

v2.28.0

23 Nov 16:30
Compare
Choose a tag to compare

Summary

This release adds support for Data Validation and automatic OpenAPI generation in Event Handler.

Even better, it works with your existing resolver (API Gateway REST/HTTP, ALB, Lambda Function URL, VPC Lattice)!

Did you read that correctly? Yes, you did! Look at this:

image (9)

Data validation

Docs: Data validation

By adding enable_validation=True to your resolver constructor, you’ll change the way the resolver works. We will:

  1. inspect your route handlers to gather input and output types (including Pydantic models and dataclasses)
  2. validate and coerce the input data for you automatically before invoking your route handlers
  3. validate and coerce the output data for you automatically after invoking your route handlers
  4. enable a cool feature (see the next section!)

This moves data validation responsibilities to Event Handler resolvers, reducing a ton of boilerplate code. You can now focus on just writing your business logic, and leave the validation to us!

from typing import List, Optional

import requests
from pydantic import BaseModel, Field

from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities.typing import LambdaContext

tracer = Tracer()
logger = Logger()
app = APIGatewayRestResolver(enable_validation=True)  


class Todo(BaseModel):  
    userId: int
    id_: Optional[int] = Field(alias="id", default=None)
    title: str
    completed: bool


@app.post("/todos")
def create_todo(todo: Todo) -> str:  
    response = requests.post("https://jsonplaceholder.typicode.com/todos", json=todo.dict(by_alias=True))
    response.raise_for_status()

    return response.json()["id"]  


@app.get("/todos")
@tracer.capture_method
def get_todos() -> List[Todo]:
    todo = requests.get("https://jsonplaceholder.typicode.com/todos")
    todo.raise_for_status()

    return todo.json()  


@logger.inject_lambda_context(correlation_id_path=correlation_paths.API_GATEWAY_HTTP)
@tracer.capture_lambda_handler
def lambda_handler(event: dict, context: LambdaContext) -> dict:
    return app.resolve(event, context)

OpenAPI generation

Docs: OpenAPI generation

When you enable data validation, we automatically inspect your API in a way that makes it possible to generate OpenAPI specifications automatically!

You can export the OpenAPI spec for customization, manipulation, merging micro-functions, etc., in two ways:

  • Pydantic model using app.get_openapi_schema()
  • JSON Schema using app.get_openapi_json_schema()

Here’s one way to print the schema if you were to run your Python Lambda handler locally:

import requests

from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.event_handler.openapi.models import Contact, Server
from aws_lambda_powertools.utilities.typing import LambdaContext

app = APIGatewayRestResolver(enable_validation=True)


@app.get("/todos/<todo_id>")
def get_todo_title(todo_id: int) -> str:
    todo = requests.get(f"https://jsonplaceholder.typicode.com/todos/{todo_id}")
    todo.raise_for_status()

    return todo.json()["title"]


def lambda_handler(event: dict, context: LambdaContext) -> dict:
    return app.resolve(event, context)


if __name__ == "__main__":
    print(
        app.get_openapi_json_schema(
            title="TODO's API",
            version="1.21.3",
            summary="API to manage TODOs",
            description="This API implements all the CRUD operations for the TODO app",
            tags=["todos"],
            servers=[Server(url="https://stg.example.org/orders", description="Staging server")],
            contact=Contact(name="John Smith", email="[email protected]"),
        ),
    )

Can you see where this is going? Keep reading :)

Swagger UI

Docs: Swagger UI

Last but not least... you can now enable an embedded Swagger UI to visualize and interact with your newly auto-documented API!

from typing import List, Optional

import requests
from pydantic import BaseModel, Field

from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities.typing import LambdaContext

app = APIGatewayRestResolver(enable_validation=True)  
app.enable_swagger()  # by default, path="/swagger"

@app.get("/todos")
@tracer.capture_method
def get_todos() -> List[Todo]:
    todo = requests.get("https://jsonplaceholder.typicode.com/todos")
    todo.raise_for_status()

    return todo.json()
    
def lambda_handler(event: dict, context: LambdaContext) -> dict:
    return app.resolve(event, context)

The Swagger UI appears by default at the /swagger path, but you can customize this to serve the documentation from another path, and specify the source for Swagger UI assets.

image (10)

We can’t wait for you try this new features!

Changes

  • fix(event_handler): fix format for OpenAPI path templating (#3399) by @rubenfonseca
  • fix(event_handler): allow fine grained Response with data validation (#3394) by @rubenfonseca
  • fix(event_handler): apply serialization as the last operation for middlewares (#3392) by @rubenfonseca

🌟New features and non-breaking changes

  • feat(event_handler): allow customers to catch request validation errors (#3396) by @rubenfonseca

📜 Documentation updates

🐛 Bug and hot fixes

🔧 Maintenance

  • chore(deps-dev): bump the boto-typing group with 1 update (#3400) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.110.0 to 2.110.1 (#3402) by @dependabot
  • chore(deps): bump datadog-lambda from 4.82.0 to 5.83.0 (#3401) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.110.0 to 2.110.1 (#3403) by @dependabot
  • chore(deps-dev): bump pytest-xdist from 3.4.0 to 3.5.0 (#3387) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.35.0 to 1.36.0 (#3388) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3389) by @dependabot

This release was made possible by the following contributors:

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

v2.27.1

21 Nov 16:18
Compare
Choose a tag to compare

Summary

This patch release addresses the following issues:

  • Static typing. Mypy/Pyright no longer complains about Logger.addFilter/removeFilter
  • Documentation. Add note in Event Handler that Amazon API Gateway doesn't handle catch all (*/*) binary types when CORS is configured
  • Logger Correlation ID. You can now use Powertools custom JMESPath Functions to extract correlation ID from data serialized in JSON string, Base64, and GZIP -- @logger.inject_lambda_context("powertools_json(body).my_field")

🌟 Big thanks to @rafrafek and @martinber for their critical eye in spotting some of these issues

Changes

🌟New features and non-breaking changes

  • feat(logger): implement addFilter/removeFilter to address static typing errors (#3380) by @heitorlessa

📜 Documentation updates

  • docs(event_handlers): note that CORS and / binary mime type don't work in API Gateway (#3383) by @heitorlessa
  • fix(logger): allow custom JMESPath functions to extract correlation ID (#3382) by @heitorlessa
  • chore(deps): bump squidfunk/mkdocs-material from 2c57e4d to fc42bac in /docs (#3375) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from f486dc9 to 2c57e4d in /docs (#3366) by @dependabot
  • docs(logger): improve ALC messaging in the PT context (#3359) by @heitorlessa
  • docs(logger): Fix ALC link (#3352) by @leandrodamascena

🐛 Bug and hot fixes

  • fix(logger): allow custom JMESPath functions to extract correlation ID (#3382) by @heitorlessa

🔧 Maintenance

  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3374) by @dependabot
  • chore(deps): bump actions/github-script from 7.0.0 to 7.0.1 (#3377) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 2 updates (#3376) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 2c57e4d to fc42bac in /docs (#3375) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.83.2 to 0.83.3 (#3363) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.108.1 to 2.110.0 (#3365) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.5 to 0.1.6 (#3364) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.109.0 to 2.110.0 (#3361) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from f486dc9 to 2c57e4d in /docs (#3366) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 11 updates (#3362) by @dependabot
  • chore(ci): lint and type checking removal in Pydantic v2 quality check (#3360) by @leandrodamascena
  • chore(deps-dev): bump aws-cdk from 2.108.1 to 2.109.0 (#3354) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3353) by @dependabot

This release was made possible by the following contributors:

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

v2.27.0

16 Nov 15:56
Compare
Choose a tag to compare

Summary

This minor release adds support for two new environments variables to configure the log level in Logger.

You can now configure the log level of for Logger using two new environment variables: AWS_LAMBDA_LOG_LEVEL and POWERTOOLS_LOG_LEVEL.

The new environment variables will work along the existing LOG_LEVEL variable that is now considered legacy and will be removed in the future.

Setting the log level now follows this order:

  1. AWS_LAMBDA_LOG_LEVEL environment variable
  2. Setting the log level in code using the level constructor option, or by calling the logger.setLevel() method
  3. POWERTOOLS_LOG_LEVEL environment variable

Changes

📜 Documentation updates

🔧 Maintenance

  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3345) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.108.0 to 2.108.1 (#3344) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.107.0 to 2.108.1 (#3343) by @dependabot
  • chore(deps): bump datadog-lambda from 4.81.0 to 4.82.0 (#3338) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3340) by @dependabot
  • chore(deps): bump fastjsonschema from 2.18.1 to 2.19.0 (#3337) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.106.1 to 2.108.0 (#3341) by @dependabot
  • chore(deps-dev): bump pytest-xdist from 3.3.1 to 3.4.0 (#3332) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.106.0 to 2.107.0 (#3333) by @dependabot
  • chore(deps): bump actions/github-script from 6.4.1 to 7.0.0 (#3330) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.83.1 to 0.83.2 (#3335) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.34.0 to 1.35.0 (#3334) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3329) by @dependabot
  • chore(deps): bump actions/dependency-review-action from 3.1.2 to 3.1.3 (#3331) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.106.0 to 2.106.1 (#3328) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.105.0 to 2.106.0 (#3319) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.105.0 to 2.106.0 (#3320) by @dependabot

This release was made possible by the following contributors:

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

v2.26.1

10 Nov 13:47
Compare
Choose a tag to compare

Summary

This patch release fixes a regression when using prefix stripping with middlewares on the event handler. It also fixes a mistyped field on the Kinesis Firehose event source, and a problem when getting multiple encrypted SSM parameters.

Huge thanks to @roger-zhangg and @sean-hernon for helping us identifying and fixing these issues.

Changes

  • fix(event_handler): Router prefix mismatch regression after Middleware feat (#3302) by @leandrodamascena
  • fix(event_source): kinesis subsequenceNumber str type to int (#3275) by @roger-zhangg
  • fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple ssm parameters. (#3241) by @sean-hernon

📜 Documentation updates

  • chore(deps): bump squidfunk/mkdocs-material from 772e14e to f486dc9 in /docs (#3299) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from df9409b to 772e14e in /docs (#3265) by @dependabot
  • docs(event-handler): fixed SchemaValidationMiddleware link (#3247) by @jvnsg
  • docs(customer-reference): add Vertex Pharmaceuticals as a customer reference (#3210) by @leandrodamascena
  • chore(deps): bump squidfunk/mkdocs-material from cb38dc2 to df9409b in /docs (#3216) by @dependabot

🔧 Maintenance

  • chore(deps-dev): bump ruff from 0.1.4 to 0.1.5 (#3315) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 3 updates (#3314) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3313) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.104.0 to 2.105.0 (#3309) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3310) by @dependabot
  • chore(deps): bump actions/dependency-review-action from 3.1.1 to 3.1.2 (#3308) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.104.0 to 2.105.0 (#3307) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3305) by @dependabot
  • chore(deps): bump actions/dependency-review-action from 3.1.0 to 3.1.1 (#3301) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.0 to 3.0.1 (#3300) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 772e14e to f486dc9 in /docs (#3299) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3298) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.3 to 0.1.4 (#3297) by @dependabot
  • feat(event_handler): add ability to expose a Swagger UI (#3254) by @rubenfonseca
  • chore(deps-dev): bump aws-cdk-lib from 2.103.1 to 2.104.0 (#3291) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.33.1 to 1.34.0 (#3290) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.5 to 3.0.0 (#3289) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.103.1 to 2.104.0 (#3288) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3287) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3282) by @dependabot
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 2.1.4 to 2.1.5 (#3281) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3278) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.32.0 to 1.33.1 (#3277) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 1 update (#3273) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.83.0 to 0.83.1 (#3274) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.103.0 to 2.103.1 (#3264) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.103.0 to 2.103.1 (#3263) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from df9409b to 772e14e in /docs (#3265) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.102.0 to 2.103.0 (#3259) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.2 to 0.1.3 (#3257) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.102.0 to 2.103.0 (#3258) by @dependabot
  • chore(deps): bump actions/setup-node from 3.8.1 to 4.0.0 (#3244) by @dependabot
  • chore(deps-dev): bump pytest from 7.4.2 to 7.4.3 (#3249) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 2 updates (#3248) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.1 to 0.1.2 (#3250) by @dependabot
  • feat(event_handler): generate OpenAPI specifications and validate input/output (#3109) by @rubenfonseca
  • chore(deps-dev): bump the boto-typing group with 2 updates (#3242) by @dependabot
  • chore(deps): bump ossf/scorecard-action from 2.3.0 to 2.3.1 (#3245) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.82.2 to 0.83.0 (#3243) by @dependabot
  • chore(deps-dev): bump ruff from 0.1.0 to 0.1.1 (#3235) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 1 update (#3231) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.101.1 to 2.102.0 (#3232) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.82.0 to 0.82.2 (#3229) by @dependabot
  • chore(deps): bump datadog-lambda from 4.80.0 to 4.81.0 (#3228) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.81.0 to 0.82.0 (#3224) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.101.0 to 2.101.1 (#3223) by @dependabot
  • chore(deps): bump urllib3 from 1.26.17 to 1.26.18 (#3222) by @dependabot
  • chore(deps-dev): bump urllib3 from 1.26.17 to 1.26.18 in /layer (#3221) by @dependabot
  • chore(deps): bump actions/checkout from 4.1.0 to 4.1.1 (#3220) by @dependabot
  • chore(deps): bump release-drafter/release-drafter from 5.24.0 to 5.25.0 (#3219) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.292 to 0.1.0 (#3213) by @dependabot
  • chore(deps-dev): bump aws-cdk-lib from 2.100.0 to 2.101.1 (#3217) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.100.0 to 2.101.0 (#3214) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from cb38dc2 to df9409b in /docs (#3216) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3215) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 2 updates (#3211) by @dependabot

This release was made possible by the following contributors:

@dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @jvnsg, @leandrodamascena, @roger-zhangg, @rubenfonseca and @sean-hernon

v2.26.0

13 Oct 16:49
Compare
Choose a tag to compare

v2.26.0 Release notes

Summary

This release adds richer exception details to the logger utility, support for VPC Lattice Payload V2, smarter model inference in the parser utility, expanded ARM64 Lambda Layer support on additional regions, and fixes some bugs!

⭐ Huge thanks to our new contributors: @Tom01098, @stevrobu, and @pgrzesik!

Richer exception details

Docs: logger

The logger utility now logs exceptions in a structured format to simplify debugging. Previously, exception tracebacks appeared as a single string containing the raw stack trace frames. Developers had to parse each frame manually to extract file names, line numbers, function names, etc.

With the new serialize_stacktrace flag, the logger prints stack traces as structured JSON. This clearly surfaces exception details like filenames, lines, functions, and statements per frame. The structured output eliminates the need to parse traceback strings, improving observability and accelerating root cause analysis.

image

image

Amazon VPC Lattice Payload V2

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.

With this seamless integration, you can now leverage the performance benefits of Amazon VPC Lattice Payload V2 directly in your event handlers. The latest release enables handling Lattice events using the familiar event handler API you already know, including critical features like CORS support and response serialization.

image

Model inference in the parser utility

Docs: parser

The event_parser decorator previously required you to duplicate the type when using type hints. Now, the event_parser decorator can infer the event type directly from your handler signature. This avoids having to redeclare the type in the event_parser decorator.

image

Changes

🌟New features and non-breaking changes

📜 Documentation updates

  • fix(logger): force Logger to use local timezone when UTC flag is not set (#3168) by @roger-zhangg
  • docs(event_handler): add information about case-insensitive header lookup function (#3183) by @pgrzesik
  • chore(deps): bump squidfunk/mkdocs-material from a4cfa88 to cb38dc2 in /docs (#3189) by @dependabot
  • chore(deps): bump gitpython from 3.1.35 to 3.1.37 in /docs (#3188) by @dependabot
  • docs(contributing): initial structure for revamped contributing guide (#3133) by @heitorlessa
  • chore(deps): bump squidfunk/mkdocs-material from cbfecae to a4cfa88 in /docs (#3175) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from e5f28aa to cbfecae in /docs (#3157) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 06673a1 to e5f28aa in /docs (#3134) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from b41ba6d to 06673a1 in /docs (#3124) by @dependabot

🐛 Bug and hot fixes

🔧 Maintenance

  • fix(logger): force Logger to use local timezone when UTC flag is not set (#3168) by @roger-zhangg
  • chore(deps-dev): bump the boto-typing group with 1 update (#3196) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3198) by @dependabot
  • chore(deps): bump aws-xray-sdk from 2.12.0 to 2.12.1 (#3197) by @dependabot
  • chore(deps-dev): bump sentry-sdk from 1.31.0 to 1.32.0 (#3192) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from a4cfa88 to cb38dc2 in /docs (#3189) by @dependabot
  • chore(deps): bump gitpython from 3.1.35 to 3.1.37 in /docs (#3188) by @dependabot
  • feat(logger): new stack_trace field with rich exception details (#3147) by @stevrobu
  • chore(deps-dev): bump aws-cdk from 2.99.1 to 2.100.0 (#3185) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates (#3177) by @dependabot
  • chore(deps): bump ossf/scorecard-action from 2.2.0 to 2.3.0 (#3178) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.80.4 to 0.81.0 (#3179) by @dependabot
  • docs(contributing): initial structure for revamped contributing guide (#3133) by @heitorlessa
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3174) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from cbfecae to a4cfa88 in /docs (#3175) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 1 update (#3170) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.80.3 to 0.80.4 (#3166) by @dependabot
  • chore(deps-dev): bump urllib3 from 1.26.16 to 1.26.17 in /layer (#3163) by @dependabot
  • chore(deps): bump urllib3 from 1.26.16 to 1.26.17 (#3162) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.291 to 0.0.292 (#3161) by @dependabot
  • chore(deps): bump fastjsonschema from 2.18.0 to 2.18.1 (#3159) by @dependabot
  • chore(deps): bump actions/setup-python from 4.7.0 to 4.7.1 (#3158) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.99.0 to 2.99.1 (#3155) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3156) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from e5f28aa to cbfecae in /docs (#3157) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.98.0 to 2.99.0 (#3148) by @dependabot
  • chore(deps-dev): bump types-requests from 2.31.0.5 to 2.31.0.6 (#3145) by @dependabot
  • chore(deps): bump pydantic from 1.10.12 to 1.10.13 (#3144) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 2 updates (#3143) by @dependabot
  • feat(data_masking): add new sensitive data masking utility (#2197) by @seshubaws
  • chore(deps-dev): bump aws-cdk from 2.97.0 to 2.98.0 (#3139) by @dependabot
  • chore(deps-dev): bump types-requests from 2.31.0.3 to 2.31.0.5 (#3136) by @dependabot
  • chore(deps-dev): bump the boto-typing group with 1 update (#3135) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from 06673a1 to e5f28aa in /docs (#3134) by @dependabot
  • chore(deps-dev): bump ruff from 0.0.290 to 0.0.291 (#3126) by @dependabot
  • chore(deps): bump actions/checkout from 4.0.0 to 4.1.0 (#3128) by @dependabot
  • chore(deps-dev): bump aws-cdk from 2.96.2 to 2.97.0 (#3129) by @dependabot
  • chore(deps): bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update (#3127) by @dependabot
  • chore(deps-dev): bump cfn-lint from 0.80.2 to 0.80.3 (#3125) by @dependabot
  • chore(deps): bump squidfunk/mkdocs-material from b41ba6d to 06673a1 in /docs (#3124) by @dependabot

This release was made possible by the following contributors:

@Tom01098, @dependabot, @dependabot[bot], @github-actions, @github-actions[bot], @heitorlessa, @leandrodamascena, @rubenfonseca, @pgrzesik, @roger-zhangg, @seshubaws, @stephenbawks and @stevrobu