Summary
In this release we are excited to announce support for AWS Lambda Managed Instanced across all Powertools utilities, along with .Net 10 support, and a new typed batch decorator.
Thank you @fuguiKz for your first documentation contribution ⭐
What's New
🚀 Lambda Managed Instances Support
This release introduces full thread safety across all Powertools utilities, enabling seamless support for AWS Lambda Managed Instances.
What are Lambda Managed Instances?
Lambda Managed Instances runs your functions on fully-managed EC2 instances in your account, supporting multi-concurrent invocations where a single execution environment processes multiple requests simultaneously. This improves resource utilization for IO-heavy workloads but requires thread-safe code.
🔒 Thread Safety Improvements
To fully support Lambda Managed Instances, we've implemented thread safety across all utilities:
- Logging - Per-thread scope storage using ConcurrentDictionary ensures log context isolation between concurrent requests (#1078, #1099)
- Tracing - Async context preservation with thread-safe segment management (#1082)
- Metrics - Concurrent collections and isolation prevent metric bleed between requests (#1080)
- Idempotency - AsyncLocal context and thread-safe configuration for reliable idempotency checks (#1084)
- Parameters - Immutable cache objects, atomic cache updates with AddOrUpdate, and Interlocked operations for thread-safe parameter retrieval (#1098)
✨ New Features
- Batch Typed Decorator - New type safe decorator for batch processing, providing new interfaces that accept and serialize automatically your custom types. (#1034)
public class Product
{
public int Id { get; set; }
public string? Name { get; set; }
public decimal Price { get; set; }
}
public class TypedSqsRecordHandler : ITypedRecordHandler<Product> // (1)!
{
public async Task<RecordHandlerResult> HandleAsync(Product product, CancellationToken cancellationToken)
{
/*
* Your business logic with automatic deserialization.
* If an exception is thrown, the item will be marked as a partial batch item failure.
*/
Logger.LogInformation($"Processing product {product.Id} - {product.Name} (${product.Price})");
if (product.Id == 4) // (2)!
{
throw new ArgumentException("Error on id 4");
}
return await Task.FromResult(RecordHandlerResult.None); // (3)!
}
}
[BatchProcessor(TypedRecordHandler = typeof(TypedSqsRecordHandler))]
public BatchItemFailuresResponse HandlerUsingTypedAttribute(SQSEvent _)
{
return TypedSqsBatchProcessor.Result.BatchItemFailuresResponse; // (4)!
}🎯 .NET 10 Support
- Added .NET 10.0 as a supported target framework (#1105)
- Removed .NET 6.0 support (end of life) (#1106)
Changes
🌟New features and non-breaking changes
- feat(logging): thread safety with ConcurrentDictionary for scope storage (#1099) by @hjgraca
- feat: batch typed decorator (#1034) by @hjgraca
- feat(idempotency): enhance thread safety with AsyncLocal context and thread-safe configuration (#1084) by @hjgraca
- feat(tracing): thread safety and async context preservation in Powertools Tracing (#1082) by @hjgraca
- feat(metrics): thread safety with concurrent collections and isolation for metrics (#1080) by @hjgraca
- feat(logging): implement thread-safe logging with per-thread scope storage (#1078) by @hjgraca
📜 Documentation updates
- chore: Fix examples projects to include projectreferences (#1110) by @hjgraca
- docs: extract batch processing snippets (#1104) by @fuguiKz
- chore(deps): bump squidfunk/mkdocs-material from
980e11fto3bba0a9in /docs (#1107) by @dependabot[bot] - chore: update .NET runtime support to 10.0 and remove 6.0 (#1106) by @hjgraca
- feat: batch typed decorator (#1034) by @hjgraca
- chore(deps): bump squidfunk/mkdocs-material from
f5c556ato980e11fin /docs (#1057) by @dependabot[bot]
🔧 Maintenance
- chore: Fix examples projects to include projectreferences (#1110) by @hjgraca
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#1108) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
980e11fto3bba0a9in /docs (#1107) by @dependabot[bot] - chore(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#1092) by @dependabot[bot]
- chore(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#1090) by @dependabot[bot]
- chore: update .NET runtime support to 10.0 and remove 6.0 (#1106) by @hjgraca
- chore: add .NET 10.0 support and update target frameworks (#1105) by @hjgraca
- chore(parameters): Thread safety (#1098) by @hjgraca
- chore(deps): update AWS Lambda and Powertools package versions (#1102) by @hjgraca
- chore: fix e2e tests (#1100) by @hjgraca
- chore(batch-processing): add concurrency and stress tests (#1096) by @hjgraca
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 4.0.0 to 4.0.1 (#1093) by @dependabot[bot]
- chore(deps): bump pymdown-extensions from 10.14.3 to 10.16.1 (#1089) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.31.7 to 4.31.9 (#1091) by @dependabot[bot]
- chore: remove versioning-strategy from nuget dependabot (#1094) by @dreamorosi
- chore: enable dependabot for more ecosystems (#1088) by @dreamorosi
- chore(deps): bump peter-evans/create-pull-request from 7.0.9 to 8.0.0 (#1075) by @dependabot[bot]
- chore: Bump version from 3.0.2 to 3.1.0 (#1086) by @hjgraca
- chore(deps): bump codecov/codecov-action from 5.5.1 to 5.5.2 (#1074) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.31.5 to 4.31.7 (#1073) by @dependabot[bot]
- chore(deps): bump actions/setup-node from 6.0.0 to 6.1.0 (#1070) by @dependabot[bot]
- chore(deps): bump actions/checkout from 6.0.0 to 6.0.1 (#1069) by @dependabot[bot]
- chore(deps): bump urllib3 from 2.5.0 to 2.6.0 (#1071) by @dependabot[bot]
- chore(deps): bump aws-actions/configure-aws-credentials from 5.1.0 to 5.1.1 (#1066) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.31.4 to 4.31.5 (#1067) by @dependabot[bot]
- chore(deps): bump actions/setup-python from 6.0.0 to 6.1.0 (#1065) by @dependabot[bot]
- chore(deps): bump actions/setup-dotnet from 5.0.0 to 5.0.1 (#1064) by @dependabot[bot]
- chore(deps): bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 (#1063) by @dependabot[bot]
- chore(deps): bump actions/checkout from 5.0.1 to 6.0.0 (#1062) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.31.3 to 4.31.4 (#1061) by @dependabot[bot]
- chore(deps): bump js-yaml from 3.14.1 to 3.14.2 in /examples/Event Handler/BedrockAgentFunction/infra (#1059) by @dependabot[bot]
- chore(deps): bump actions/checkout from 5.0.0 to 5.0.1 (#1060) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
f5c556ato980e11fin /docs (#1057) by @dependabot[bot] - chore(deps): bump github/codeql-action from 4.31.0 to 4.31.3 (#1058) by @dependabot[bot]
This release was made possible by the following contributors:
@dependabot[bot], @dreamorosi, @fuguiKz, @hjgraca and dependabot[bot]