Skip to content

v3.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 07 Oct 14:25
· 20 commits to refs/heads/develop since this release
cfa4560

Summary

We're excited to announce a major release with new features and important updates:

  • Strongly-typed batch processor with automatic deserialization for SQS, Kinesis, and DynamoDB events
  • Enhanced tracing with improved metadata error handling
  • Bug fix for logging sampling rate

This major version bump reflects significant breaking changes as we update our supported runtimes and dependencies.

Breaking Changes

⚠️ Important: Please review these breaking changes before upgrading:

Migration guide to v3

  • Removed support for .NET 6 - We now require .NET 8 or later
  • AWS SDK v3 no longer supported - We have migrated to AWS SDK v4
  • Version alignment - All Powertools for AWS Lambda utilities will maintain version parity going forward

New Features

Strongly-Typed Batch Processor

📖 Documentation | Migration Guide

Process batch events with type safety and automatic deserialization.

What's New:

  • ITypedRecordHandler<T> and ITypedRecordHandlerWithContext<T> interfaces for strongly-typed processing
  • Specialized processors: TypedSqsBatchProcessor, TypedKinesisEventBatchProcessor, TypedDynamoDbStreamBatchProcessor
  • Automatic JSON deserialization from event records to your types
  • Optional ILambdaContext injection for timeout handling and request tracking

Example Usage:

Simple typed handler:

public class OrderHandler : ITypedRecordHandler<Order>
{
    public async Task<RecordHandlerResult> HandleAsync(Order order, CancellationToken cancellationToken)
    {
        // Direct access to strongly-typed object - no manual deserialization!
        await ProcessOrder(order);
        return RecordHandlerResult.Successful;
    }
}

With Lambda context support (docs):

public class ProductHandlerWithContext : ITypedRecordHandlerWithContext<Product>
{
    public async Task<RecordHandlerResult> HandleAsync(Product product, ILambdaContext context, CancellationToken cancellationToken)
    {
        Logger.LogInformation($"Processing product {product.Id} in request {context.AwsRequestId}");
        Logger.LogInformation($"Remaining time: {context.RemainingTime.TotalSeconds}s");

        // Use context for timeout handling
        if (context.RemainingTime.TotalSeconds < 5)
        {
            Logger.LogWarning("Low remaining time, processing quickly");
        }

        return RecordHandlerResult.Successful;
    }
}

Contributors

Thank you @dcabib for your contributions to this release! ⭐

Changes

🐞 Bug fixes

  • fix(logging): Fix sampling when log level is above Debug #980 @dcabib

📜 Documentation updates

  • chore: remove dotnet6 from docs and add migration guides for v2 and v3 (#1021) by @hjgraca
  • chore(deps): bump squidfunk/mkdocs-material from 86d21da to 00f9276 in /docs (#1013) by @dependabot[bot]
  • chore: Tracing sanitize metadata (#1011) by @hjgraca
  • chore(deps): bump squidfunk/mkdocs-material from 209b62d to 86d21da in /docs (#996) by @dependabot[bot]

🔧 Maintenance

This release was made possible by the following contributors:

@dependabot[bot], @hjgraca and dependabot[bot]