简体   繁体   中英

Converting ASP.NET API To AWS Lambdas

I have a asp.net core 3.1 API application that I have been using as my backend api.

I have this application hosted in one AWS Lambda Function, with API Gateway, with one HTTP route and having the ASP.NET Core application handle the routing.

Looking around the web and reading docs, it seems the standard would be to have one HTTP API Route per Lambda Function, (So as I interpreted it would mean having every ASP.NET controller of my API in one lambda function).

Meaning since I have 14 routes it would seems I would need 14 lambda functions with API endpoints. Also this would mean basically no longer having a ASP.NET core API, and disassembling the application.

I have no issues in completing this, just wanted to know if this is actually the correct why and the new normal in developing api's.

It is possible to route several endpoints to the same lambda function as explained here . But I believe most people try to use one lambda per endpoint.

As for what you say about the new normal in developing APIs i would caution you to believe the hype too much. Serverless definitely has a place in modern web development but it is not replacing traditional APIs that i have seen where i have worked.

Yes, one lambda for endpoint (not per controller)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM