MinimalLambda.Templates
2.6.0
dotnet new install MinimalLambda.Templates@2.6.0
MinimalLambda.Templates
dotnet new templates for MinimalLambda AWS Lambda projects.
Overview
MinimalLambda.Templates provides ready-to-build AWS Lambda project templates for the MinimalLambda framework. The templates create a Lambda function project, an integration test project, and AWS Lambda deployment defaults using the same src/ and test/ layout as the AWS .NET Lambda blueprints.
Use it to:
- Start new Lambda projects: Generate a complete function folder with
src/<Name>andtest/<Name>.Tests - Add functions to existing repositories: Use the standard
dotnet new-o .option to write into the current solution folder - Choose standard or Native AOT: Start with regular JIT deployment or AOT-friendly project settings
- Test immediately: Generated test projects use
MinimalLambda.Testingand xUnit - Deploy with AWS tooling: Generated projects include
aws-lambda-tools-defaults.json
Installation
Install the template package from NuGet:
dotnet new install MinimalLambda.Templates
Update to the latest published version by running the same command again:
dotnet new install MinimalLambda.Templates
Uninstall the templates:
dotnet new uninstall MinimalLambda.Templates
List installed MinimalLambda templates:
dotnet new list mlambda
Local template development
From the repository root, pack and install the templates from your local checkout:
dotnet pack src/MinimalLambda.Templates/MinimalLambda.Templates.csproj -c Release
dotnet new install ./src/MinimalLambda.Templates --force
dotnet new list mlambda
Run a full standard-template smoke test:
mkdir -p /tmp/minimal-lambda-template-test
cd /tmp/minimal-lambda-template-test
rm -rf FullRunStandard
dotnet new mlambda -n FullRunStandard --profile default --region us-east-1
dotnet test FullRunStandard/test/FullRunStandard.Tests/FullRunStandard.Tests.csproj
Run a full Native AOT-template smoke test:
mkdir -p /tmp/minimal-lambda-template-test
cd /tmp/minimal-lambda-template-test
rm -rf FullRunAot
dotnet new mlambda-aot -n FullRunAot --profile default --region us-east-1
dotnet test FullRunAot/test/FullRunAot.Tests/FullRunAot.Tests.csproj
Run an existing-solution smoke test:
mkdir -p /tmp/minimal-lambda-template-test/ExistingSolutionRun
cd /tmp/minimal-lambda-template-test/ExistingSolutionRun
dotnet new sln -n ExistingSolutionRun
dotnet new mlambda -n AddedFunction -o . --profile default --region us-east-1
dotnet sln add src/AddedFunction/AddedFunction.csproj
dotnet sln add test/AddedFunction.Tests/AddedFunction.Tests.csproj --include-references false
dotnet test
Quick Start
Create a new Lambda folder from a parent directory:
dotnet new mlambda -n MyLambda
cd MyLambda
dotnet test test/MyLambda.Tests/MyLambda.Tests.csproj
Generated layout:
MyLambda/
src/MyLambda/
MyLambda.csproj
Program.cs
aws-lambda-tools-defaults.json
README.md
test/MyLambda.Tests/
MyLambda.Tests.csproj
LambdaTests.cs
Add a Lambda to an existing repository or solution folder:
dotnet new mlambda -n MyLambda -o .
dotnet sln add src/MyLambda/MyLambda.csproj
dotnet sln add test/MyLambda.Tests/MyLambda.Tests.csproj
This creates src/MyLambda and test/MyLambda.Tests beside your existing solution instead of nesting them under a new MyLambda folder.
Templates
| Template | Short name | Use when |
|---|---|---|
| MinimalLambda AWS Lambda Function | mlambda |
Starting a standard MinimalLambda function |
| MinimalLambda AWS Lambda Function configured for Native AOT | mlambda-aot |
Starting a Native AOT MinimalLambda function |
Template Options
Both templates support AWS profile and region replacement in aws-lambda-tools-defaults.json:
dotnet new mlambda -n MyLambda --profile default --region us-east-1
dotnet new mlambda-aot -n MyAotLambda --profile prod --region eu-west-1
Use the same options when generating into an existing repository:
dotnet new mlambda -n MyLambda -o . --profile default --region us-east-1
dotnet new mlambda-aot -n MyAotLambda -o . --profile prod --region eu-west-1
Central Package Management
Like the built-in .NET and AWS Lambda templates, MinimalLambda templates emit versioned PackageReference items. If your repository uses Central Package Management, move those versions into Directory.Packages.props after generation.
Add or update these package versions at the repository root:
<ItemGroup>
<PackageVersion Include="MinimalLambda" Version="2.6.0" />
<PackageVersion Include="MinimalLambda.Testing" Version="2.6.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
Then remove Version="..." from the generated PackageReference items in the app and test .csproj files.
Native AOT
Create a new Native AOT Lambda folder:
dotnet new mlambda-aot -n MyAotLambda
Add a Native AOT Lambda to an existing repository or solution folder:
dotnet new mlambda-aot -n MyAotLambda -o .
dotnet sln add src/MyAotLambda/MyAotLambda.csproj
dotnet sln add test/MyAotLambda.Tests/MyAotLambda.Tests.csproj
The AOT template includes:
PublishAot=truePublishTrimmed=trueTrimMode=partialJsonSerializerIsReflectionEnabledByDefault=false- A generated
JsonSerializerContextinProgram.cs
Deploy
Install the AWS Lambda .NET CLI tool if needed:
dotnet tool install -g Amazon.Lambda.Tools
Deploy from the generated function project directory:
cd src/MyLambda
dotnet lambda deploy-function
For the new-folder templates, first enter the generated folder:
cd MyLambda/src/MyLambda
dotnet lambda deploy-function
Other Packages
Additional packages in the minimal-lambda framework for runtime hosting, testing, observability, and event source handling.
License
This project is licensed under the MIT License. See LICENSE for details.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.6.0 | 121 | 6/12/2026 |
| 2.6.0-beta.1 | 58 | 6/12/2026 |