Dev Planet
Dev Planet
  • 9
  • 1 825
Build a Serverless REST API using API Gateway, Lambda (.NET) and DynamoDB | Deploy API using AWS SAM
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/apigateway/latest/developerguide/http-api-vs-rest.html
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/Serverless-REST-API-Lambdas
Getting Started with AWS SAM (3 basic commands): th-cam.com/video/TDi1-QOgMLw/w-d-xo.htmlsi=fjxDw50Q9SYtbgw3
Cold Start of a .NET Lambda function: th-cam.com/video/mXL-t5TBF-M/w-d-xo.htmlsi=LpjhxcxmxZA-_pfk
API Gateway Stages: docs.aws.amazon.com/apigateway/latest/developerguide/http-api-stages.html
มุมมอง: 155

วีดีโอ

How to run Lambda function on Dev machine | SAM local invoke command | Locally invoke a Lambda
มุมมอง 1345 หลายเดือนก่อน
In this video, I show you how we can use SAM to invoke a Lambda function locally for testing purposes while in the development phase. Local invocation means running the Lambda function on the development machine without deploying to AWS. This adds to the developers' productivity and speeds up the coding process. This is the second video of my series on AWS SAM. In a previous video (th-cam.com/v...
Deploy a .NET8 Lambda Function using SAM | SQS to Lambda to S3 | Visual Studio 2022 IDE
มุมมอง 975 หลายเดือนก่อน
This video is in continuation of my previous video about getting started with AWS SAM. In this video, we see how to deploy a stack containing a .NET8 Lambda function to AWS using SAM. To deploy a Lambda function, first, we need to write the function code. In this video, I use Visual Studio 2022 to create a .NET8 Lambda function that has the event source mapping to an SQS event, processes the me...
Getting started with AWS SAM | IaC for Serverless Apps | Step-by-step Demo
มุมมอง 945 หลายเดือนก่อน
AWS SAM or Serverless Application Model is a CLI-based tool that provides the Infrastructure as Code (IaC) capability to deploy serverless applications to AWS and some developers' productivity tools like local invocation and testing of Lambda functions. SAM is basically just an extension to AWS CloudFormation for serverless resources. A template file in either JSON or YAML contains the code for...
AWS Lambda Supports .NET 8 | Create / Upgrade to .NET 8 Lambda | Why should you use it?
มุมมอง 3206 หลายเดือนก่อน
In this video I share the good news that as of February 28, 2024 - AWS Lambda supports .NET 8 as a managed runtime! .NET 8 is the latest Long Term Support (LTS) version of cross-platform .NET, released in November 2023. .NET 8 includes performance improvements, container enhancements, C# language simplified syntax, Blazor support for full-stack web applications, and ASP.NET Core partial support...
Reserved and Provisioned Concurrency of Lambda functions | When and why should you use one?
มุมมอง 2516 หลายเดือนก่อน
In this video, I have discussed the AWS Lambda Service concurrency. Using an analogy of a restaurant I have elaborated the difference between Unreserved, Reserved, and Provisioned Concurrency. Mainly, I have addressed the following questions:- What is AWS Lambda Service Concurrency What is the difference between the Reserved and Provisioned Concurrency of Lambda functions? What are some use cas...
.Net Lambda Functions Cold Start | Comparison with Node and Python | Is it bad and how to reduce it?
มุมมอง 1576 หลายเดือนก่อน
.Net lambda functions are often perceived to be suffering from a bad cold start. But is there some substance to this perception? In this video, I discuss an experiment I have done to calculate the cold-start time of a simple .Net Lambda function and compare it with the equivalent Node.js and Python functions. For those new to the serverless arena, I briefly discuss what we mean by the cold and ...
Develop, Debug and Deploy C# .Net Lambda Functions | AWS Toolkit for Visual Studio | Step-by-step
มุมมอง 5087 หลายเดือนก่อน
In this video, I demo how we can get started with C# based .Net Lamba Functions for AWS using AWS Toolkit for Visual Studio 2022. The AWS Toolkit for Visual Studio is an extension for Microsoft Visual Studio that makes it easier for developers to develop, debug, and deploy .NET applications using AWS. This Toolkit allows developers to create serverless applications with minimal administration a...
Step-by-step guide to download, install and configure AWS CLI on Windows, and why you should!
มุมมอง 1117 หลายเดือนก่อน
AWS Command-line Interface (CLI) is an open-source tool for developers to interact with AWS services from their development machines using a command-line shell. In this video, we will see how to download and install it on a Windows 10 computer and then create a user in AWS Identify and Access Management (IAM) with programmatic access for the CLI to authenticate with AWS.