3

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.

2
  • 1
    Yes, it appears that the Cloud9 editor in-built to the AWS Lambda console does not support the version indicated. You can still package your code into a Zip and upload it via the Actions menu. See: AWS Lambda Deployment Package in C# - AWS Lambda Commented Jun 26, 2020 at 6:19
  • Thanks! @John Rotenstein it works for the CLI based empty lambda function. I need to deploy the serverless api to connect with api gateway service.While creating this serverless lambda api it shows error in deploying the api. Commented Jun 26, 2020 at 8:28

1 Answer 1

6

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>
Sign up to request clarification or add additional context in comments.

2 Comments

@Harish When linking to your own site or content (or content that you are affiliated with), you must disclose your affiliation in the answer in order for it not to be considered spam. Having the same text in your username as the URL or mentioning it in your profile is not considered sufficient disclosure under Stack Exchange policy.
Thanks, @Yatin. I've edited the answer to disclose my affiliation with the links in my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.