Is there any example code for using Lambda with DynamoDB in the .NET 6 runtime?

0

I'm trying to create a Visual Studio serverless .NET 6.0 project with multiple Lambda functions, called from an API route. The Lambda functions need to have DynamoDB injected so I can read and write to the database. (so I do not need a Lambda function responding to DynamoDB events)

Using Visual Studio 2022, when I create a AWS Serverless application (with or without tests) using .NET Core 3.1 there is a blueprint for Serverless Blog using DynamoDB and Lambda. However, .NET 3.1 is deprecated and as soon as I installed .NET 6.0 this blueprint disappeared. I tried upgrading the .NET Core 3.1 template by changing all the references to dotnetcore3.1 to dotnet6 but this still resulted in a rollback when publishing the project. Do any examples exist of executing operations on DynamoDB when calling a Lambda function from an API call? The only examples I could find are for executing a Lambda function in response to a DynamoDB event.

In addition to the blueprints in the AWS Toolkit for Visual Studio, there are examples on github: https://github.com/aws-samples/aws-net-guides . However, those are also for the (deprecated!) .NET 5 runtime. As you can see here, .NET 5 has been deprecated since May 10th, 2022: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html The examples not being upgraded makes setting up a project unnecessarily difficult. The entire concept of virtualising your server architecture using AWS is very easy to understand, the execution is slow if you don't know exactly how to setup your project.

Thanks in advance to anyone who knows where to find this information.

preguntada hace un año478 visualizaciones
1 Respuesta
1
  • Very much appreciated David! I'll take a look at these.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas