CdkReloaded.Net.Runtime.Lambda
0.1.1
dotnet add package CdkReloaded.Net.Runtime.Lambda --version 0.1.1
NuGet\Install-Package CdkReloaded.Net.Runtime.Lambda -Version 0.1.1
<PackageReference Include="CdkReloaded.Net.Runtime.Lambda" Version="0.1.1" />
<PackageVersion Include="CdkReloaded.Net.Runtime.Lambda" Version="0.1.1" />
<PackageReference Include="CdkReloaded.Net.Runtime.Lambda" />
paket add CdkReloaded.Net.Runtime.Lambda --version 0.1.1
#r "nuget: CdkReloaded.Net.Runtime.Lambda, 0.1.1"
#:package CdkReloaded.Net.Runtime.Lambda@0.1.1
#addin nuget:?package=CdkReloaded.Net.Runtime.Lambda&version=0.1.1
#tool nuget:?package=CdkReloaded.Net.Runtime.Lambda&version=0.1.1
CDK Reloaded
Write .NET functions. Get AWS infrastructure for free.
CDK Reloaded is a .NET 10 framework that eliminates the gap between writing application code and deploying it to AWS. Define HTTP functions and DynamoDB tables with simple interfaces and attributes — the framework auto-generates Lambda functions, API Gateway routes, and DynamoDB tables via AWS CDK.
dotnet run → Local Kestrel server with in-memory DynamoDB
dotnet run -- deploy → Publishes to Lambda, generates CDK, deploys to AWS
Zero CloudFormation. Zero YAML. Zero Terraform. Just C#.
Quick Start
1. Create a new project
dotnet new web -n MyApi
cd MyApi
dotnet add package CdkReloaded.Net
2. Define a model
using CdkReloaded.Abstractions;
public class Order : ITableEntity
{
[PartitionKey] public string Id { get; set; } = default!;
public string CustomerName { get; set; } = default!;
public decimal Total { get; set; }
}
3. Write a function
using CdkReloaded.Abstractions;
public record CreateOrderRequest(string CustomerName, decimal Total);
public record CreateOrderResponse(string Id);
[HttpApi(Method.Post, "/orders")]
public class CreateOrder(ITable<Order> orders) : IHttpFunction<CreateOrderRequest, CreateOrderResponse>
{
public async Task<CreateOrderResponse> HandleAsync(CreateOrderRequest request, CancellationToken ct = default)
{
var order = new Order
{
Id = Guid.NewGuid().ToString(),
CustomerName = request.CustomerName,
Total = request.Total
};
await orders.PutAsync(order, ct);
return new CreateOrderResponse(order.Id);
}
}
4. Wire it up
using CdkReloaded.Hosting;
var builder = CloudApplication.CreateBuilder(args);
builder.AddFunctions().FromAssembly();
builder.AddTables().FromAssembly();
var app = builder.Build();
app.Run();
5. Run it
# Local development (Kestrel + in-memory DynamoDB)
dotnet run
# Deploy to AWS (Lambda + API Gateway + DynamoDB)
dotnet run -- deploy
That's it. The same code runs locally and on AWS.
CLI Commands
| Command | Description |
|---|---|
dotnet run |
Start local development server |
dotnet run -- deploy |
Build, synthesize CDK, deploy to AWS |
dotnet run -- synth |
Generate CloudFormation template without deploying |
dotnet run -- diff |
Show changes between local and deployed stack |
dotnet run -- destroy |
Remove the deployed AWS stack |
dotnet run -- list |
List all discovered functions and tables |
How It Works
Your Code (.NET 10)
|
v
CloudApplicationBuilder.Build()
├── Discovers [HttpApi] functions via reflection
├── Discovers ITableEntity models
├── Validates DI dependencies
└── Resolves runtime based on execution mode
|
┌──────┼──────────────┐
v v v
Local Lambda CDK Deploy
Runtime Runtime Runtime
| | |
v v v
Kestrel AWS Lambda dotnet publish
+ InMemory + DynamoDB + CDK synth
Tables Tables + cdk deploy
Three execution modes, one codebase:
- Local (
dotnet run): ASP.NET Kestrel server with in-memory DynamoDB tables - Lambda (AWS): Lambda custom runtime with real DynamoDB
- Deploy (
dotnet run -- deploy): Generates and deploys AWS CDK infrastructure
Runtimes are auto-discovered via assembly scanning — just add the NuGet package and the framework finds it.
Documentation
| Document | Description |
|---|---|
| Getting Started | Step-by-step tutorial |
| Architecture | How the framework works internally |
| Functions | Writing HTTP functions |
| DynamoDB | Table abstraction and data modeling |
| Configuration | Defaults, per-function config, options |
| CLI Reference | All CLI commands in detail |
| Deployment | AWS deployment guide |
| Error Handling | Exception hierarchy and error responses |
Project Structure
src/
CdkReloaded.Abstractions/ # Interfaces, attributes (IFunction, ITable, [HttpApi])
CdkReloaded.Hosting/ # Builder, discovery, CLI, runtime abstraction
CdkReloaded.DynamoDb/ # InMemoryTable + DynamoDbTable implementations
CdkReloaded.Runtime.Local/ # Kestrel-based local dev server
CdkReloaded.Runtime.Lambda/ # AWS Lambda custom runtime
CdkReloaded.Cdk/ # CDK stack generation + deploy
CdkReloaded/ # Meta-package (references all above)
samples/
CdkReloaded.Sample.OrderApi/ # Complete example application
tests/
CdkReloaded.*.Tests/ # Unit and integration tests
Requirements
- .NET 10 SDK
- Node.js (for AWS CDK CLI, only needed for deployment)
- AWS CLI configured (only needed for deployment)
Key Design Principles
Convention over configuration — Functions are discovered by scanning for
[HttpApi]+IHttpFunction<,>. Tables are discovered by scanning forITableEntity. No manual registration needed.Same code, everywhere — Your function code doesn't know if it's running on Kestrel or Lambda.
ITable<T>resolves toInMemoryTable<T>locally andDynamoDbTable<T>on AWS.Infrastructure from code — The CDK runtime reads your function/table registrations and generates CloudFormation. No separate IaC files to maintain.
Fail fast — DI dependencies are validated at build time. Missing services throw
DependencyValidationExceptionbefore the app starts, not at request time.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.APIGatewayEvents (>= 2.7.3)
- Amazon.Lambda.Core (>= 2.8.1)
- Amazon.Lambda.RuntimeSupport (>= 1.14.2)
- Amazon.Lambda.Serialization.SystemTextJson (>= 2.4.5)
- CdkReloaded.Net.DynamoDb (>= 0.1.1)
- CdkReloaded.Net.Hosting (>= 0.1.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CdkReloaded.Net.Runtime.Lambda:
| Package | Downloads |
|---|---|
|
CdkReloaded.Net
Meta-package for CdkReloaded.Net — includes all components for building serverless .NET apps with auto-generated AWS CDK infrastructure. |
GitHub repositories
This package is not used by any popular GitHub repositories.