For those of us that are .NET developers at heart, we finally have the ability to run server-less C# applications on AWS! Support for the C# Language in AWS Lambda was announced at AWS re:Invent 2016 (1-Dec-2016). This post is a quick getting started guide to help you get started.
C# support in Lambda requires use of .NET Core targeted assemblies as the Core CLR offers cross platform support enabling the Linux based Lambda infrastructure to execute .NET complied binaries. Lambda accepts the zipped build output of .NET Core targeted class library rather than raw code for C# Lambda fucntions. Function handlers are referenced using he syntax <Assembly Name>::<Fully Qualified Class Name>::<Method Name>. Which in the case of a project with output assembly named "myassembly", a namespace of "myassemblynamespace", a class named "myclass" and a method named "mymethod" would be "myassembly::myassemblynamespace.myclass::mymethod". AWS Provides a project type and tooling through its Toolkit for Visual Studio that enable creation of C# Lambda functions however you can build your own from a standard class library project.
Development Environment (See .NET Core Installation Guide)
- Visual Studio 2015 with Update 3
- .NET Core Tools
AWS Visual Studio IDE ToolKit
- AWS SDK for .NET (v184.108.40.206 or greater required)
- AWS Toolkit for Visual Studio (v220.127.116.11 or greater required)
Required Project References:
- Amazon.Lambda.Core (Install-Package Amazon.Lambda.Core)
- Amazon.Lambda.Serialization.Json (Install-Package Amazon.Lambda.Serialization.Json)
- Amazon.Lambda.Tools (Install-Package Amazon.Lambda.Tools -Pre)