.NET 6 Lambda Amazon Linux 2 Custom Runtime Error

Viewed 338

I am trying to run a .NET 6 lambda on the Amazon Linux 2 runtime.

Trying to get the following example to work: https://github.com/normj/LambdaNETCoreSamples/tree/master/CustomRuntimeListBucketsNET6

I have tried both this example, and my own sample project with similar configurations and continue to get the following error: Error: fork/exec /var/task/bootstrap: exec format error Runtime.InvalidEntrypoint. I have set the lambda handler value to "provided", "bootstrap" etc in the AWS UI but continue to get the same error.

The error suggests that the entry point is invalid, what should the handler value on the lambda be in AWS for this?

Also, I am using "dotnet lambda package" to create a zip and push the application via zip, is this causing the problem?

1 Answers

AWS Lambda now (Feb 24, 2022) supports .NET 6 as both a managed runtime and a container base image.

To build and deploy Lambda functions using .NET 6, use the .NET Core CLI, AWS Toolkit for Visual Studio, or AWS Serverless Application Model (AWS SAM). Additionally, you can also use the AWS-provided .NET 6 base image to build and deploy .NET 6 functions using a container image.

See the Announcement here

For more information on Lambda’s support for .NET 6, see the blog post at .NET 6 runtime now available in AWS Lambda.

Related