AWS Lambda: The code editor does not support the .NET Core 3.1 (C#/PowerShell) runtime

Viewed 2697

When I am trying to select the runtime for my AWS Lambda function. It shows:

The code editor does not support the .NET Core 3.1 (C#/PowerShell) runtime

Has anyone faced issues like this? Please help me out! Thanks in advance.

1 Answers

C# code cannot be edited in the Lambda console. Use the .NET Core CLI to create & deploy your Lambda function. The steps to do so can be found in my blog post here. Here's a summary of the same:

  1. Install .NET Core from here.
  2. Install Lambda templates:
dotnet new --install Amazon.Lambda.Templates
  1. Create Lambda function:
dotnet new lambda.EmptyFunction --name MyFunction
  1. Install .NET Core Global Tool:
dotnet tool install -g Amazon.Lambda.Tools
  1. Deploy the function:
dotnet lambda deploy-function MyFunction --profile <AWS CLI profile>
  1. Invoke the function:
dotnet lambda invoke-function MyFunction --payload "Hello World" --profile <AWS CLI profile>
Related