簡體   English   中英

使用與無服務器數據庫對話的 Lambda function 集成的 AWS API 網關創建完全無服務器的解決方案

[英]Creating a completely serverless solution using AWS API Gateway integrated with a Lambda function that talks to a serverless database

I am looking to create completely serverless AWS solution using an AWS API Gateway which will have endpoints that will integrate with a Lambda function that will interact with a simple third party Web API w/ http requests and additionally a serverless db of some sort to persist data .

下面是我想要做的事情的一個例子:

GET: my-api-gateway-endpoint/products/1 Lambda function 將知道它是產品的 GET 且參數為 1,因此它將運行適當的 ZC1C425268E68385D1AB507 以查詢數據庫並返回 Product

POST: my-api-gateway-endpoint/products Lambda function will know that it is a POST for products so will run the appropriate function to call a third party Web API through http and insert it there but additionally insert the product into my db

DELETE: my-api-gateway-endpoint/products/1 Lambda function will know that it is a DELETE request for products with Id 1 so it will run the appropriate function to call the third party Web API through http and delete it there but additionally查詢我的數據庫並刪除 ID 為 1 的產品

我正在嘗試找出合適的堆棧來完成工作,以下是我到目前為止的想法:-API Gateway

- 用 C# 編寫並上傳的單個 Lambda function 並上傳,處理所有類型的請求。 與第三方對話 Web API 以及無服務器數據庫

- Aurora Db serverless w/ Data API 已啟用。 想法是通過 C# lambda function 與此對話以持久化和查詢數據。

當我看到有人在 Z04A7DA3C5B04CAD85DA1EEBBZ2 中托管整個 Asp.net 核心 web API 項目時,我開始有點困惑。 也許這是我 go 的路徑。 我找不到一個關於如何使用 C# 訪問 Aurora Db 無服務器數據 API 的示例。

誰能給我一些關於這個堆棧是否會讓我走上正確的軌道來完成工作的見解,或者給出我可以布置它的另一種方式的任何想法。

我正在尋找完全無服務器且盡可能簡單的方法。 我也不關心 Lambda 是什么語言,但我更喜歡 C#。

如果您只需要通過productId訪問產品,這是 DynamoDB(基本上是具有一些額外功能的鍵值存儲)而不是 Aurora Serverless 的一個很好的用例。

AWS 博客提供了如何創建 .NET Lambda function的演練,包括與 ZDB974238714CA8DE63ZF7DACE14 的集成。 DynamoDB 文檔包含非常全面的示例, 說明如何將 DynamoDB SDK用於 .NET。 最后,這里是一個示例項目,它使用 API 網關/Lambda/DynamoDB 基礎設施和 .NET。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM