Skip to content

Getting Started

AwsLambda.Host brings ASP.NET Core–style hosting, dependency injection, and middleware to AWS Lambda. Instead of wiring up serialization and context handling manually, you configure a Lambda-specific host that manages scopes, middleware, and strongly typed handlers at compile time.

Why AwsLambda.Host?

  • Familiar patterns – Builder APIs, DI, and middleware mirror ASP.NET Core.
  • Source-generated handlers – Avoid reflection while staying AOT ready.
  • Lambda-focused lifecycle – Startup, invocation, and shutdown hooks map to the Lambda runtime model.
  • Type-safe envelopes – Request/response contracts are validated at compile time.

Prerequisites

Before you begin, ensure you have:

  • .NET 8 SDK or laterDownload here
  • C# 11 or later – Required for source generators and language features
  • Basic AWS Lambda knowledge – Understanding of Lambda concepts (functions, events, execution model)
  • AWS Account – For deploying and testing (optional for local development)

IDE Recommendations

  • Visual Studio 2022 (17.8+)
  • JetBrains Rider 2023.3+
  • Visual Studio Code with C# Dev Kit

Start Here

  • Installation – Add the NuGet packages and configure your csproj.
  • Your First Lambda – Walk through a handler, DI setup, and local testing.
  • Core Concepts – Learn about the host lifecycle, middleware, and source generation.

Prefer to explore? Head directly to Guides or Examples for deeper dives.

Framework Highlights

  • Async-first runtime – Cancellation tokens, timeout awareness, and scoped services work as expected.
  • Middleware pipeline – Implement interception logic such as logging, validation, or OpenTelemetry spans in one place.
  • Envelope integrations – Map SQS, SNS, API Gateway, and custom payloads using the envelope abstractions.
  • Observability-ready – First-class OpenTelemetry integration for traces and metrics.

Explore Features

  • Envelopes – Type-safe event source integration (SQS, SNS, API Gateway, etc.)
  • OpenTelemetry – Distributed tracing and observability
  • AOT Compilation – Optimize for fastest cold starts (coming soon)
  • Source Generators – Understand compile-time optimizations (coming soon)

Getting Help

If you run into issues or have questions:

Continue with Installation to configure your project.