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.

已提問 1 年前檢視次數 478 次
1 個回答
1

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南