Skip to content

v3.24.0

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Jan 13:44
· 13 commits to refs/heads/develop since this release

Summary

This release adds support for Lambda durable function replay in idempotency, a new parser model for DynamoDB Stream on-failure destinations, and a fix for batch processor. We've also dropped Python 3.9 support.

A super thanks to @ConnorKirk for implementing the idempotency replay feature and @exg for the batch processor fix and DynamoDB Stream parser model 🚀🌟

Idempotency: Allow durable functions to replay

Docs

AWS Lambda durable functions enable you to build resilient multi-step applications that can execute for up to one year while maintaining reliable progress despite interruptions. When a durable function resumes from a wait point or interruption, the system performs replay - running your code from the beginning but skipping completed checkpoints.

This release adds support for durable function replay in idempotency. When using the @idempotent decorator on lambda_handler, replay is automatically detected from the DurableContext - no manual configuration needed.

from aws_lambda_powertools.utilities.idempotency import idempotent, DynamoDBPersistenceLayer, IdempotencyConfig

persistence_layer = DynamoDBPersistenceLayer(table_name="idempotency_store")
config = IdempotencyConfig(event_key_jmespath="body")

@idempotent(config=config, persistence_store=persistence_layer)
def lambda_handler(event, context):
    # Replay is automatically detected when context is a DurableContext
    # During replay, INPROGRESS records are handled gracefully
    return {"statusCode": 200}

DynamoDB Stream On-Failure Destination parser model

Docs

A new parser model DynamoDBStreamLambdaOnFailureDestinationModel is now available for parsing DynamoDB Stream on-failure destination events.

from aws_lambda_powertools.utilities.parser import parse
from aws_lambda_powertools.utilities.parser.models import DynamoDBStreamLambdaOnFailureDestinationModel

def lambda_handler(event, context):
    parsed = parse(event=event, model=DynamoDBStreamLambdaOnFailureDestinationModel)
    
    batch_info = parsed.ddb_stream_batch_info
    print(f"Failed batch from shard: {batch_info.shard_id}")
    print(f"Stream ARN: {batch_info.stream_arn}")

Changes

  • refactor(event-handler): remove kwargs from AppSync exception constructor (#7699) by @T90REAL

🌟New features and non-breaking changes

📜 Documentation updates

  • docs(homepage): reorganize homepage and create dedicated installation page (#7896) by @leandrodamascena
  • docs(readme): update features list and improve readability (#7889) by @leandrodamascena
  • feat(parser): add model for the DynamoDB Stream Lambda invocation record (#7818) by @exg
  • docs(event-handler): add docstring for serializer in BedrockAgentFunctionResolver (#7808) by @dreamorosi
  • docs: add EF Education First as customer reference (#7809) by @dreamorosi
  • docs: clarify BedrockResponse.is_json() always returns True (#7748) by @oyiz-michael

🐛 Bug and hot fixes

  • fix(batch_processor): fix batch processor (#7798) by @exg
  • fix(data-classes): ensure lazy initialization for Cognito token generation response properties (#7653) by @nc-dirknilius
  • fix(ci): add missing dollar signs in SSM parameter path variables (#7695) by @Iamrodos

🔧 Maintenance

This release was made possible by the following contributors:

@ConnorKirk, @Iamrodos, @T90REAL, @dependabot[bot], @dreamorosi, @exg, @github-actions[bot], @leandrodamascena, @nc-dirknilius, @oyiz-michael, dependabot[bot] and github-actions[bot]