Amazon.Lambda.AspNetCoreServer.Hosting 1.0.0 The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved

Install-Package Amazon.Lambda.AspNetCoreServer.Hosting -Version 1.0.0
dotnet add package Amazon.Lambda.AspNetCoreServer.Hosting --version 1.0.0
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Amazon.Lambda.AspNetCoreServer.Hosting --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Amazon.Lambda.AspNetCoreServer.Hosting, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Amazon.Lambda.AspNetCoreServer.Hosting as a Cake Addin
#addin nuget:?package=Amazon.Lambda.AspNetCoreServer.Hosting&version=1.0.0

// Install Amazon.Lambda.AspNetCoreServer.Hosting as a Cake Tool
#tool nuget:?package=Amazon.Lambda.AspNetCoreServer.Hosting&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Amazon.Lambda.AspNetCoreServer.Hosting

This package allows ASP .NET Core applications written using the minimal api style to be deployed as AWS Lambda functions. This is done by adding a call to AddAWSLambdaHosting to the services collection of the application. This method takes in the LambdaEventSource enum that configures which Lambda event source the Lambda function will be configured for.

The AddAWSLambdaHosting will setup the Amazon.Lambda.AspNetCoreServer package to process the incoming Lambda events as ASP .NET Core requests. It will also initialize Amazon.Lambda.RuntimeSupport package to interact with the Lambda service.

Sample ASP .NET Core application

The code sample below is the typical initilization code for an ASP .NET Core application using the minimal api style. The one difference is the extra line of code calling AddAWSLambdaHosting.

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

// Register Lambda to replace Kestrel as the web server for the ASP.NET Core application.
// If the application is not running in Lambda then this method will do nothing. 
builder.Services.AddAWSLambdaHosting(LambdaEventSource.HttpApi);

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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
1.0.0 584 11/5/2021