![]() |
VOOZH | about |
This package has been renamed to MinimalLambda.Abstractions. Please migrate to the new package: MinimalLambda.Abstractions
dotnet add package AwsLambda.Host.Abstractions --version 1.3.1
NuGet\Install-Package AwsLambda.Host.Abstractions -Version 1.3.1
<PackageReference Include="AwsLambda.Host.Abstractions" Version="1.3.1" />
<PackageVersion Include="AwsLambda.Host.Abstractions" Version="1.3.1" />Directory.Packages.props
<PackageReference Include="AwsLambda.Host.Abstractions" />Project file
paket add AwsLambda.Host.Abstractions --version 1.3.1
#r "nuget: AwsLambda.Host.Abstractions, 1.3.1"
#:package AwsLambda.Host.Abstractions@1.3.1
#addin nuget:?package=AwsLambda.Host.Abstractions&version=1.3.1Install as a Cake Addin
#tool nuget:?package=AwsLambda.Host.Abstractions&version=1.3.1Install as a Cake Tool
Core interfaces and abstractions for the aws-lambda-host framework.
Core interfaces and delegates that define the AwsLambda.Host framework contract. This package provides:
This package is typically used implicitly by , but is essential if you're building custom integrations, middleware components, or extensions to the framework.
Install via NuGet:
dotnet add package AwsLambda.Host.Abstractions
Or specify a version:
dotnet add package AwsLambda.Host.Abstractions --version <version>
Ensure your project uses C# 11 or later:
<PropertyGroup>
<LangVersion>11</LangVersion>
</PropertyGroup>
This package is typically included automatically when you use . Direct installation is only necessary when building custom integrations or extensions.
The framework uses three specialized builder interfaces for configuring different Lambda execution phases, providing clear separation of concerns:
ILambdaInvocationBuilder
Configures the Lambda invocation request/response pipeline:
Handle(LambdaInvocationDelegate handler) – Register the Lambda invocation handler that processes
each incoming eventUse(Func<LambdaInvocationDelegate, LambdaInvocationDelegate> middleware) – Add middleware to the
invocation pipeline; middleware is composed sequentially and can inspect/modify the context before
and after invocationHandler (property) – The currently registered invocation handlerMiddlewares (property) – Collection of registered middleware componentsProperties (property) – Key/value collection for sharing between the builder phases and all
invocationsServices (property) – IServiceProvider for accessing registered services during configurationBuild() – Compiles the configured handler and middleware into an executable
LambdaInvocationDelegateILambdaOnInitBuilder
Configures the initialization phase (runs once on cold start):
OnInit(LambdaInitDelegate handler) – Register initialization handlers that run before the first
invocation; handlers are executed and return true to proceed or false to abort initializationInitHandlers (property) – Collection of registered initialization handlersServices (property) – IServiceProvider for accessing registered services during configurationBuild() – Compiles the configured handlers into an executable initialization delegate with
concurrent execution and error aggregationILambdaOnShutdownBuilder
Configures the shutdown phase (runs once before Lambda termination):
OnShutdown(LambdaShutdownDelegate handler) – Register shutdown handlers that run during cleanup;
handlers execute sequentially for graceful resource releaseShutdownHandlers (property) – Collection of registered shutdown handlersServices (property) – IServiceProvider for accessing registered services during configurationBuild() – Compiles the configured handlers into an executable shutdown delegate with sequential
execution and error loggingThese interfaces are obtained from LambdaApplication after calling Build(). The builder pattern
flow is:
LambdaApplication.CreateBuilder()
→ Configure services
→ .Build()
→ Returns LambdaApplication (implementing all three builder interfaces)
→ Configure invocation pipeline (ILambdaInvocationBuilder)
→ Configure init handlers (ILambdaOnInitBuilder)
→ Configure shutdown handlers (ILambdaOnShutdownBuilder)
This design separates concerns between request/response handling, initialization, and lifecycle cleanup. See for detailed usage examples and the complete builder API.
Encapsulates a single Lambda invocation and provides access to contextual information and services:
ServiceProvider – Access to the scoped DI container for resolving services during invocationCancellationToken – Cancellation signal triggered when Lambda approaches its timeout, allowing
graceful shutdownFeatures – IFeatureCollection providing access to custom functionalaty within the invocation
pipeline such as for accessing the invocation Event or Response dataItems – IDictionary<object, object?> for storing invocation-scoped data; cleared per
invocationProperties – IDictionary<string, object?> for accessing shared data configured during the
build phase; persists across invocationsRawInvocationData – Raw stream access to serialized event and response data via
RawInvocationData.Event and RawInvocationData.ResponseProperties and Items serve different purposes:
Provides a factory for creating cancellation token sources configured for AWS Lambda invocations:
NewCancellationTokenSource(ILambdaContext) – Creates a CancellationTokenSource that cancels
before the Lambda function timeout, allowing time for graceful shutdownThis interface enables custom implementations for managing cancellation tokens with respect to Lambda's remaining execution time. The default implementation applies a configurable buffer duration to ensure operations complete before the Lambda runtime's hard timeout.
IRequestEnvelope
Defines a contract for extracting and deserializing incoming Lambda event payloads. Implementations extract the inner payload from the outer Lambda event structure and deserialize it for handler processing.
IResponseEnvelope
Defines a contract for serializing and packing handler results into Lambda response structures. Implementations serialize the handler result and place it in the appropriate location within the outer response structure.
These abstractions enable strongly-typed handling of AWS Lambda events (like API Gateway, SQS) with automatic payload extraction and response packing. See the envelope packages for concrete implementations.
LambdaInvocationDelegate
Task LambdaInvocationDelegate(ILambdaHostContext context)
Processes a Lambda invocation.
LambdaInitDelegate
Task<bool> LambdaInitDelegate(IServiceProvider services, CancellationToken cancellationToken)
Runs once during initialization. Return true to continue, false to abort.
LambdaShutdownDelegate
Task LambdaShutdownDelegate(IServiceProvider services, CancellationToken cancellationToken)
Runs once during shutdown for cleanup.
The abstractions represent three Lambda execution phases:
LambdaInitDelegate runs once during function initializationLambdaInvocationDelegate runs for each eventLambdaShutdownDelegate runs once before terminationFor implementation details and examples, see .
Additional packages in the aws-lambda-host framework for abstractions, observability, and event source handling.
This project is licensed under the MIT License. See for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|