Build a REST API (CRUD) with AWS Lambda, API Gateway & DynamoDB Using Python | Step-by-Step Guide
HTML-код
- Опубликовано: 6 июл 2024
- In this tutorial, you'll learn how to build a fully functional CRUD (Create, Read, Update, Delete) API using AWS Lambda, API Gateway, and DynamoDB with Python.
Lambda Python Code: (Copy & paste this into Lambda ) github.com/hitchon1/AWS_RestL...
In this vide we will cover:
-We will create a REST API in API gateway with several different endpoint and all the CRUD methods
-Write python code in Lambda to process all methods and resources part of the API Gateway
-Creating a dynamoDB table to store data from our API
-Create the IAM roles to use cloudwatch and dynamoDB
0:00 Intro to Architecture
0:45 Create DynamoDB Table
1:22 Create the Lambda Handler
1:51 Creating the IAM Role
2:30 API Gateway
3:10 Creating API Gateway Resources & Methods
7:00 The Lambda Code
10:58 Postman: Creating post for Employee (Adding entries to the table)
13:37 Debugging in Cloudwatch logs
14:20 Postman: GET
15:16 Postman: PATCH
16:40 Postman: DELETE
17:25 Outro
#awstutorial #awslambda #restapis Наука
Amazing tutorial THANK YOU!
YOU ARE AMAZING
YOU ARE AMAZING
YOU ARE AMAZING
This short video summarizes many topics which needs hours to be explained.
This is a great tutorial, super straight forward and easy to understand, thank you!!
This tutorial really worked for me, keep it up! :)
First out of many that have actually worked, thank you so much.
Great 👍 glad you got things working!
You covered it all, great vid!
Nice one
Great work..thanks ❤❤❤❤
This was a massive help with my uni assignment. Thanks and keep it up!
You too wish you good luck and success with your studies !
please use react for future project
I am not getting the http method in event and if i print the event it only prints the payload.. i want to fetch the http method but i am unable to do that
Thank you, the video instructions are very specific and detailed. I have a question, if I change the body in postman to x-www-urlencoded, which code in the lambda should I change and how? Can you guide me, thank you.
Hi, Thanks for watching :)
you'll need to make a few changes in the way the Lambda function parses the request body in POST, PATCH, and DELETE. Let me show you POST as an example,
So
You'll need this -> from urllib.parse import parse_qs
And then you will need to replace -> response = save_employee(json.loads(event['body']))
With the following code:
parsed_body = parse_qs(event['body'])
for key in parsed_body:
parsed_body[key] = parsed_body[key][0]
response = save_employee(parsed_body)
I have not tested it but I think above would help achieve what you need. Hope this helps!
@@Hitchon
Thank you very much. Hope you can release more aws tutorial videos, I'm looking forward to them.