Рет қаралды 137
Amazon API Gateway, AWS Lambda Function, and Amazon DynamoDB make a very powerful trio to implement serverless RESTful APIs. They are all serverless, highly scalable, and cost only when used (pay-per-use).
In this video, I show build a Serverless CRUD REST API using these three services. I used .NET8 runtime for the Lambda functions and AWS SAM (IaC) to deploy these to my AWS Account.
Amazon API Gateway is a fully managed service that allows developers to publish, maintain, monitor, and secure APIs at any scale. It allows developers to create APIs that access AWS services or other web services and data stored in AWS. In this video, I used AWS Lambda functions as the backend computer engine for the API Gateway. I defined POST, PUT, GET, and DELETE routes on the same API Gateway with different Lambda function integration for each.
DynamoDB is a NoSQL database service by AWS. It is not a must to have a DB in a REST API but the purpose of using it in this demo is to show you how can we use it with .NET Lambda functions for the backend of an API.
Please use the source code after necessary optimizations and validations.
Note that there is no authentication/authorization applied on the API in this demo. The deployed API Gateway URL will be accessible from the internet for everyone so use it for learning purposes only and delete the stack using “sam delete” command after testing.
01:00 Intro to the Architecture of the Serverless REST API
01:42 Manually configure an API Gateway and add Lambda integration using AWS Management Console
02:15 Differences between HTTP APIs and REST APIs
04:25 What are API Gateway stages?
05:43 The architecture of the REST API for our demo project
06:04 The C# (.NET) source code of the Lambda functions
11:07 Deploying using SAM commands
13:06 Invoking API Gateway Endpoints using Postman
Links:
Choosing between REST APIs and HTTP APIs: docs.aws.amazon.com/apigatewa...
GitHub repo link for the Visual Studio 2022 (.NET8) solution for the Lambda functions used in this demo, as well as the SAM template: github.com/DevPlanet-cloud/Se...
Getting Started with AWS SAM (3 basic commands): • Getting started with A...
Cold Start of a .NET Lambda function: • .Net Lambda Functions ...
API Gateway Stages: docs.aws.amazon.com/apigatewa...