McDoit.Aws.Lambda.Executors
0.1.1
dotnet add package McDoit.Aws.Lambda.Executors --version 0.1.1
NuGet\Install-Package McDoit.Aws.Lambda.Executors -Version 0.1.1
<PackageReference Include="McDoit.Aws.Lambda.Executors" Version="0.1.1" />
<PackageVersion Include="McDoit.Aws.Lambda.Executors" Version="0.1.1" />
<PackageReference Include="McDoit.Aws.Lambda.Executors" />
paket add McDoit.Aws.Lambda.Executors --version 0.1.1
#r "nuget: McDoit.Aws.Lambda.Executors, 0.1.1"
#:package McDoit.Aws.Lambda.Executors@0.1.1
#addin nuget:?package=McDoit.Aws.Lambda.Executors&version=0.1.1
#tool nuget:?package=McDoit.Aws.Lambda.Executors&version=0.1.1
McDoit AWS Lambda Executors
Utilities for building AWS Lambda handlers with Microsoft.Extensions.Hosting, including base executors plus SNS and SQS integrations.
Terminology
- Handler: Lambda runtime entrypoint.
- Executor: invocation/event-envelope orchestration.
- Processor: record-level SNS/SQS processing implementation.
Packages
| Package | Purpose |
|---|---|
McDoit.Aws.Lambda.Executors |
Core hosting, registration, and execution abstractions for Lambda workloads. |
McDoit.Aws.Lambda.Executors.Sns |
SNS-specific registration and executor helpers. |
McDoit.Aws.Lambda.Executors.Sqs |
SQS-specific registration and executor helpers. |
NuGet
Primary package ID:
McDoit.Aws.Lambda.Executors
Install:
dotnet add package McDoit.Aws.Lambda.Executors
If you need SNS/SQS integrations, install:
dotnet add package McDoit.Aws.Lambda.Executors.Sns
dotnet add package McDoit.Aws.Lambda.Executors.Sqs
Usage
All examples use Host.CreateApplicationBuilder(args) and register one Lambda mode per service collection.
Core event lambda
using Amazon.Lambda.Core;
using McDoit.Aws.Lambda.Executors;
using McDoit.Aws.Lambda.Executors.Extensions;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.AddEventLambda<OrderCreatedEvent, OrderCreatedEventExecutor>();
public sealed class OrderCreatedEventExecutor : IEventExecutor<OrderCreatedEvent>
{
public Task ExecuteAsync(OrderCreatedEvent? input, ILambdaContext context, CancellationToken cancellationToken)
=> Task.CompletedTask;
}
public sealed record OrderCreatedEvent(string OrderId);
Core request/response lambda
using Amazon.Lambda.Core;
using McDoit.Aws.Lambda.Executors;
using McDoit.Aws.Lambda.Executors.Extensions;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.AddRequestResponseLambda<PingRequest, PingResponse, PingExecutor>();
public sealed class PingExecutor : IRequestResponseExecutor<PingRequest, PingResponse>
{
public Task<PingResponse> ExecuteAsync(PingRequest? input, ILambdaContext context, CancellationToken cancellationToken)
=> Task.FromResult(new PingResponse($"Pong: {input?.Message ?? "empty"}"));
}
public sealed record PingRequest(string Message);
public sealed record PingResponse(string Message);
SNS typed processor
using Amazon.Lambda.Core;
using Amazon.Lambda.SNSEvents;
using McDoit.Aws.Lambda.Executors.Sns;
using McDoit.Aws.Lambda.Executors.Sns.Extensions;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.AddSnsLambda<OrderShippedNotification, OrderShippedNotificationProcessor>();
public sealed class OrderShippedNotificationProcessor : ISnsNotificationProcessor<OrderShippedNotification>
{
public Task ProcessAsync(OrderShippedNotification? notification, SNSEvent.SNSRecord record, ILambdaContext context, CancellationToken cancellationToken)
=> Task.CompletedTask;
}
public sealed record OrderShippedNotification(string OrderId);
SQS typed processor
using Amazon.Lambda.Core;
using Amazon.Lambda.SQSEvents;
using McDoit.Aws.Lambda.Executors.Sqs;
using McDoit.Aws.Lambda.Executors.Sqs.Extensions;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.AddSqsLambda<OrderCreatedMessage, OrderCreatedMessageProcessor>();
public sealed class OrderCreatedMessageProcessor : ISqsMessageProcessor<OrderCreatedMessage>
{
public Task ProcessAsync(OrderCreatedMessage message, SQSEvent.SQSMessage rawMessage, ILambdaContext context, CancellationToken cancellationToken)
=> Task.CompletedTask;
}
public sealed record OrderCreatedMessage(string OrderId);
Local development
dotnet build .\McDoit.Aws.Lambda.Executors.slnx
dotnet test .\McDoit.Aws.Lambda.Executors.slnx
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Amazon.Lambda.RuntimeSupport (>= 1.14.3)
- Amazon.Lambda.Serialization.SystemTextJson (>= 2.4.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
-
net8.0
- Amazon.Lambda.RuntimeSupport (>= 1.14.3)
- Amazon.Lambda.Serialization.SystemTextJson (>= 2.4.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
-
net9.0
- Amazon.Lambda.RuntimeSupport (>= 1.14.3)
- Amazon.Lambda.Serialization.SystemTextJson (>= 2.4.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on McDoit.Aws.Lambda.Executors:
| Package | Downloads |
|---|---|
|
McDoit.Aws.Lambda.Executors.Sns
SNS-specific AWS Lambda executors and registration helpers for typed and raw-aware notification handling. |
|
|
McDoit.Aws.Lambda.Executors.Sqs
SQS-specific AWS Lambda executors and registration helpers for typed and raw-aware message handling. |
GitHub repositories
This package is not used by any popular GitHub repositories.