Building Lambda Functions with C# - AWS Lambda

Building Lambda Functions with C#

The following sections explain how common programming patterns and core concepts apply when authoring Lambda function code in C#.

AWS Lambda provides the following libraries for C# functions:

  • Amazon.Lambda.Core – This library provides a static Lambda logger, serialization interfaces and a context object. The Context object (AWS Lambda Context Object in C#) provides runtime information about your Lambda function.

  • Amazon.Lambda.Serialization.Json – This is an implementation of the serialization interface in Amazon.Lambda.Core.

  • Amazon.Lambda.Logging.AspNetCore – This provides a library for logging from ASP.NET.

  • Event objects (POCOs) for several AWS services, including:

    • Amazon.Lambda.APIGatewayEvents

    • Amazon.Lambda.CognitoEvents

    • Amazon.Lambda.ConfigEvents

    • Amazon.Lambda.DynamoDBEvents

    • Amazon.Lambda.KinesisEvents

    • Amazon.Lambda.S3Events

    • Amazon.Lambda.SQSEvents

    • Amazon.Lambda.SNSEvents

These packages are available at Nuget Packages.

.NET Runtimes
Name Identifier Languages Operating System

.NET Core 3.1



PowerShell Core 6.0

Amazon Linux 2

.NET Core 2.1



PowerShell Core 6.0

Amazon Linux