Build a CRUD Serverless API with AWS Lambda, API Gateway and a DynamoDB from Scratch

  Рет қаралды 159,157

Felix Yu

Felix Yu

Күн бұрын

Пікірлер: 259
@FelixYu
@FelixYu 3 жыл бұрын
The interface on API Gateway has changed since the video was uploaded. there are 4 options in the beginning now. make sure you select REST API (the lower left one) to have the same interface as the video. Python Version: kzbin.info/www/bejne/b5armWxqa9aHf80 Video on API authentication (a follow-up video): kzbin.info/www/bejne/jF7ElJKQq8l0jZY Video on Node.js Express API hosted on Elastic Beanstalk: kzbin.info/www/bejne/j3vZiXuoa550fsk Register/Login system with a serverless API (Part 1): kzbin.info/www/bejne/o5jOmISqgtWfhrs Register/Login system with a serverless API (Part 2): kzbin.info/www/bejne/iJaxnIRmjdCWmdk
@Yolo-yb1nd
@Yolo-yb1nd 3 жыл бұрын
I wonder why your comment is not on the top
@videos4all-gs5uu
@videos4all-gs5uu 9 ай бұрын
whosoever is watching in 2024. Dont forget these two steps. 1. Downgrade the node js runtime to v16. 2. change the extension of index file from .mjs to .js then It will work fine.
@Kyosune
@Kyosune 9 ай бұрын
thank you so much!! saved me the trouble to try find the error before even appearing xD
@elClubdelas7Cifras
@elClubdelas7Cifras 8 ай бұрын
doenst work for me still getting 502 bad gateway
@SILD90
@SILD90 7 ай бұрын
@@elClubdelas7Cifras did you fix it? I'm having the same problem
@elClubdelas7Cifras
@elClubdelas7Cifras 7 ай бұрын
@@SILD90 yes i think i had to redo everything again with proper node version or try using sdk3 and node 20 also check permissions, thats a common issue
@rakesh8048
@rakesh8048 6 ай бұрын
​@@elClubdelas7Cifras Do You wrote in Node js 20x. I have tried but it's not working.
@Kyosune
@Kyosune 9 ай бұрын
Man, I'm not sure if this will reach you, but THANK YOU SOOOOO MUUUCH!!!. Been trying for a whole week since i've started my internship and coundn't make it work a simple get request, tryed following more than 20 tutorials and documentations and more errors we're appearing, can't describe the happiness and relief that i'm feeling right now xD.
@tylerganderson
@tylerganderson 2 жыл бұрын
Such a huge help. I'm taking a course this semester and it's my first time I'm required to use AWS services, without much previous experience with APIs. I can't express how helpful this demo will be for me. You rock.
@FelixYu
@FelixYu 2 жыл бұрын
Glad that it’s helpful :)
@anelembanga6061
@anelembanga6061 2 жыл бұрын
I just started AWS today and used your video as a starting point. Awesome, besides the differences in the AWS UI with yours and the "Missing Authentication Token" everything is going well. On AWS there are 2 options for the REST API, another way has the words (private). Thank you so much for this.
@Ziggy0120
@Ziggy0120 2 жыл бұрын
glad to know I was on the right path with this. once you get over the confusion of handlers this stuff becomes really simple.
@FelixYu
@FelixYu Жыл бұрын
Glad that u found it helpful!!
@russooneateseven
@russooneateseven 3 жыл бұрын
after reading a bunch of how to's and getting confused, this was a great step by step tutorial to watch
@FelixYu
@FelixYu 3 жыл бұрын
thanks man!! appreciate it....i also have a video where i talked abt how to add authentication to the api and throttle traffics. if you are interested: kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@russooneateseven
@russooneateseven 3 жыл бұрын
@@FelixYu thanks i'll check it out! also... for this video, i'm getting a "message": "Internal server error" through POSTMAN, and can't seem to figure out why? I checked things like my region, which matches up. I looking through Cloudwatch logs to figure it out... any suggestions? If it helps, for some reason the GET /health works, but making a POST to /product does not work, and neither do the rest. Same error for all: "message": "Internal server error".
@FelixYu
@FelixYu 3 жыл бұрын
@@russooneateseven if it returns an error that says internal server error, it means, the lambda function error out. when u look at cloudwatch, what does it show u?? does it show u the error??
@russooneateseven
@russooneateseven 3 жыл бұрын
@@FelixYu after reading through the error, the productid didn't match, because I used productId. I think there's a couple places in your tutorial using camel case and not using camelcase for productid. But that's ok. It helped me understand how to use the cloudlogs! so it fixed the post and patch requests, so they all work successfully now, accept the GET /products. (I can get a single product) but I cannot get all products. It comes up with a 404 in postman. (I made sure the url and path were correct), but that's the only thing I can think of being the issue would be the wrong path due to the 404
@FelixYu
@FelixYu 3 жыл бұрын
@@russooneateseven github.com/felixyu9/serverless-api-tutorial-code/blob/main/index.js here is the source code for the lambda. you can compare ur code with this and see if there are any mismatches....or another way to do it is to clone this and then modify from it accordingly to meet ur need!!!!
@binihalex8097
@binihalex8097 3 жыл бұрын
Thanks dude. This was an excellent tutorial. I created APIs with POST and GET methods before. Been looking for full CRUD tutorial
@FelixYu
@FelixYu 3 жыл бұрын
thanks man!! glad that it helped 👍...i also have a video that talks about how to add authentication to the api and throttle traffics. if you are interested: kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@charlesmcdonald3224
@charlesmcdonald3224 Жыл бұрын
Excellent demo of a real-world use-case of Lambda with Application Integration.
@vil3n80
@vil3n80 Жыл бұрын
FIX for: "Internal server error" & "Cannot find module 'aws-sdk' You are probably using NodeJS 18x - This video was made with NodeJS 16x Go to your lambda serverless-api function Code -> scrolls down -> Runtime settings -> edit -> change to 16x Helpful stack overflow: "AWS Lambda "cannot find module aws-sdk" in Build a Basic Web Application tutorial"
@harshalsuryawanshi8896
@harshalsuryawanshi8896 2 жыл бұрын
I absolutely loved the way you explained everything. Thank you so much for this tutorial. I need your help as I am getting 500 Internal Server Error for the health request and there's no data in the log. I cross checked I have added the cloudwatch policy.
@garyshank6242
@garyshank6242 3 жыл бұрын
Thanks for the video Felix. Please upload more videos on aws covering other services. Love the content.
@bugbite-atl
@bugbite-atl 3 жыл бұрын
Wow! One of the best tutorials! Great tutorial! Felix! Did thumbs up on the video!
@FelixYu
@FelixYu 3 жыл бұрын
glad that it helped :)
@Culekristo
@Culekristo 3 жыл бұрын
This was exactly what I needed! Keep it going please!
@FelixYu
@FelixYu 3 жыл бұрын
Thanks man!!
@joshb.9380
@joshb.9380 3 жыл бұрын
Absolutely amazing tutorial! Concise yet thorough and explained exactly what I need to know. I would be very interested in a video describing how to implement user authentication to control access to the API.
@FelixYu
@FelixYu 3 жыл бұрын
thank you sir!!!! the user authentication video will be out soon (should be within the next couple of wks) 👍
@joshb.9380
@joshb.9380 3 жыл бұрын
@@FelixYu Awesome; thanks for the reply. Your video really helped with a project I'm working on.
@FelixYu
@FelixYu 3 жыл бұрын
the api authentication video is out. check it out kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@SohailKhan-gu2du
@SohailKhan-gu2du 3 жыл бұрын
Thanks man , you saved me , i was stuck in a documentation reading limbo . Please create a playlist with creating a full blown backend project of like something , travelling app , food ordering app , and payments with stripe and such . Thanks man for the content , its really great . 💓
@FelixYu
@FelixYu 3 жыл бұрын
thank you thank you!!!! ill look into these....thanks for the suggestions!!!! 👍
@grassrootsdefi7522
@grassrootsdefi7522 3 жыл бұрын
Felix: Your work here is outstanding. Check out the API Keys lesson in the description!
@rockvnme375
@rockvnme375 3 жыл бұрын
The best tutorial I have seen. Thanks, Felix Yu
@FelixYu
@FelixYu 2 жыл бұрын
glad that it helped 👍
@anilthirunagari3618
@anilthirunagari3618 2 жыл бұрын
Really appreciate your work, I was looking for the exact tutorial. Looking forward for authentication
@FelixYu
@FelixYu 2 жыл бұрын
thank you. here is the authentication video. check it out!! kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@HeyMani92
@HeyMani92 2 жыл бұрын
Thank you, Felix, clearly explained!
@FelixYu
@FelixYu 2 жыл бұрын
Glad that you found it helpful 👍
@gibo588
@gibo588 2 жыл бұрын
Thanks Felix. I have Lambda, Gateway and Dynamo already, but inactive for a year. I have time now to update and make it big.
@FelixYu
@FelixYu 2 жыл бұрын
Nicee!!
@nimrafatima5119
@nimrafatima5119 3 жыл бұрын
Hi Felix! Really appreciate your work, I was looking the exact tutorial. This is the exact tutorial of what I wanted but it's just that I'm not familiar with NodeJS. I wanted the code in Python.
@FelixYu
@FelixYu 2 жыл бұрын
here is the python version video: kzbin.info/www/bejne/b5armWxqa9aHf80
@chidokaemeka1878
@chidokaemeka1878 3 жыл бұрын
Best Serverless API tutorial
@FelixYu
@FelixYu 3 жыл бұрын
Thank you :)
@ndeepan007
@ndeepan007 3 жыл бұрын
Expecting more like this
@VeranikaShapkina
@VeranikaShapkina 3 жыл бұрын
extremely useful, and comprehensive video. Thanks!
@amirmustafa622
@amirmustafa622 2 жыл бұрын
Thank you Felix Yu for amazing video. Your fan now :)
@FelixYu
@FelixYu 2 жыл бұрын
glad that it helped 👍
@antonarbus
@antonarbus 2 жыл бұрын
Very appreciate the tutorial, thanks for uploading
@FelixYu
@FelixYu 2 жыл бұрын
Glad that you found it helpful 👍
@mairajahus
@mairajahus 2 жыл бұрын
Where I can get the code which you written during build up API gate?
@jaykishangrover2437
@jaykishangrover2437 2 жыл бұрын
Very Well Explained. Great Work Felix!
@FelixYu
@FelixYu 2 жыл бұрын
thank you!!
@sergiyrudenko905
@sergiyrudenko905 Жыл бұрын
Thank you, Felix! Very helpful video!
@arokoyuolalekan9912
@arokoyuolalekan9912 3 жыл бұрын
This is really nice and easy to understand. Thank you.
@priyamghosh409
@priyamghosh409 2 жыл бұрын
Thanks a lot Felix.. wonderful explanation :)
@FelixYu
@FelixYu 2 жыл бұрын
I am glad that u found it helpful!! 👍
@mihirdoshi1262
@mihirdoshi1262 2 жыл бұрын
Thank you for sharing wonderful content, executed perfectly.
@FelixYu
@FelixYu 2 жыл бұрын
Glad that it’s helpful 👍
@m0bs6
@m0bs6 Жыл бұрын
This is great video... but still got "internal server error" My Mistake ✌....got typo on my script....now its work...absolutely great tutorial very easy to understand...👍👍
@FelixYu
@FelixYu Жыл бұрын
glad that u found it helpful!!
@arbazahmed1060
@arbazahmed1060 2 жыл бұрын
Guys who ever getting *internal server error* change region in code
@shivamsharma-kk3yh
@shivamsharma-kk3yh 2 жыл бұрын
make sure proxy lambda integration is checked while creating resource and method in API Gateway
@checktheprojection
@checktheprojection 3 жыл бұрын
Best api tutorial ever ! Would appreciate if you can add Cognito in a new tutorial :)
@craigd8177
@craigd8177 Жыл бұрын
Great vid man. Keep up the good work.
@mayankrathore4700
@mayankrathore4700 Жыл бұрын
This is amazing! Thanks for putting this up.
@FelixYu
@FelixYu Жыл бұрын
Glad you enjoyed it!
@hustchihieu6546
@hustchihieu6546 Жыл бұрын
this video is very useful. Thank you!
@FelixYu
@FelixYu Жыл бұрын
Glad that u found it helpful!!
@piyushbaral7444
@piyushbaral7444 3 жыл бұрын
Tutorial is really helpful. Thanks
@riazahmad5975
@riazahmad5975 2 жыл бұрын
bundle of thanks .. really awsome video ..
@MMeffert
@MMeffert 3 жыл бұрын
Felix, this is a great tutorial and answered a lot of my questions about using an API but I have a relational database that I would like the lambda to write to instead of dynamoDB. Could you do another tutorial with a relational database in mind or do you have any resources you could point me to? Thank you for all of the great content.
@thaophuong-jo9bn
@thaophuong-jo9bn Жыл бұрын
@FlixYu do you often use console in your work?
@henderstech
@henderstech Жыл бұрын
Thank you so much this is just what I needed
@sdlfkorg
@sdlfkorg 2 жыл бұрын
great tutorial! a short question, is there a good way to integrate the lambda function with git afterward? or just use serverless to do that in beginning? thanks!
@FelixYu
@FelixYu 2 жыл бұрын
kzbin.info/www/bejne/d56ri6uLgcifgrM I have a diff video that talks abt how to integrate lambda with github. Check it out
@AbhishekMishra-uh6du
@AbhishekMishra-uh6du 3 жыл бұрын
Thanks for this tutorial!
@cheyezamlondo7933
@cheyezamlondo7933 2 жыл бұрын
good day sir, i have been trying to do this tutorial using my own variable but i get the same errors on line 25 and line 29 that says saveVariable is not defined please fix or add /*global saveVariable*/. can you please kindly help me to fix it. thank you in advance.
@cheyezamlondo7933
@cheyezamlondo7933 2 жыл бұрын
i managed to fix the problem...thank you for this tutorial
@ritwiksrivastava6862
@ritwiksrivastava6862 2 жыл бұрын
@@cheyezamlondo7933 how did you fix the problem?
@panasonicdiet3691
@panasonicdiet3691 2 жыл бұрын
@@ritwiksrivastava6862 he added the word global which means variable can now be accessed from outside the func
@rohinikumari3077
@rohinikumari3077 Жыл бұрын
I'm getting 502 bad gateway. Unable to resolve this issue. Please help
@uditpandya3836
@uditpandya3836 Жыл бұрын
Check your CloudWatch logs to debug. For me, it was silly ES6 module export error.
@vishvahkannan1097
@vishvahkannan1097 2 жыл бұрын
Hi Felix, for getting specific product ,delete function, and modifying function, I am getting the error 'Internal server error 502 bad gateway' Any idea why?
@Omanshuaman
@Omanshuaman Жыл бұрын
downgrade node 18 to node 16
@saikiranvarala5072
@saikiranvarala5072 Жыл бұрын
Is that good practice to create all crud operations in single lambda function?
@michahauszczak5019
@michahauszczak5019 Жыл бұрын
no
@cnsc8941
@cnsc8941 3 жыл бұрын
Very useful tutorial, thank you
@FelixYu
@FelixYu 3 жыл бұрын
Glad that it helped..feel free to check out my other videos as well 👍
@gaganganapathy9271
@gaganganapathy9271 7 ай бұрын
What if I have a huge code base, with multiple files/modules, how do I keep that in sync with the code on my lambda and deploy continuously?
@ANKURKUMAR-pq7fb
@ANKURKUMAR-pq7fb 2 жыл бұрын
Thanks a lot for this wonderful video.
@FelixYu
@FelixYu 2 жыл бұрын
glad that u found it helpful!! 👍
@yukimister87
@yukimister87 3 жыл бұрын
Great Content Felix! It seems like the code only allows to use "Patch" to update a numeric value in DynamoDB. Attempting to update a string value (e.g. color: "red") will return an error(Internal server error). Do I have to change the Lambda code for that?
@FelixYu
@FelixYu 3 жыл бұрын
that means there is an error in the lambda function. Without seeing the detailed error message, it’s hard to tell what the problem was. u can go to the lambda console -> monitoring -> view logs in cloudwatch and then u can see what the error is and fix it accordingly.
@yukimister87
@yukimister87 3 жыл бұрын
@@FelixYu Thanks man ! Turns out I was using a reserved word in my table that prevent the update. Do you have any recommendations in terms of tutorials and documentations for someone who want get into coding in Lambda? I understand you are a self-taught software engineer :)
@FelixYu
@FelixYu 3 жыл бұрын
@@yukimister87 for learning coding in general i think the best way to do it is take some online courses to learn the basics (coursera, EdX, etc.) and then build something with it....that was my approach when i got started!!
@yukimister87
@yukimister87 3 жыл бұрын
@@FelixYu Many Thanks Felix !
@nickschmitt8594
@nickschmitt8594 3 жыл бұрын
why not a lambda for each HTTP method?
@paulwolff6405
@paulwolff6405 3 жыл бұрын
I am wondering about this too. This breaks the single responsibility principle doesn’t it?
@jefftan1098
@jefftan1098 3 жыл бұрын
Very details and nice video! Would you please share something about how to secure the Lambda function? Thank you!
@FelixYu
@FelixYu 3 жыл бұрын
here is a video on how to secure ur api via api keys (i.e., u can only access the api if u have an api key): kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@YuvalDavid-mi7sn
@YuvalDavid-mi7sn 2 жыл бұрын
Thank you felix! I have a question about the 'aws-sdk'. When I try to check my lambda function, I get a TypeError: "AWS.config is not a function". I need to download in some way the 'aws-sdk'?
@FelixYu
@FelixYu 2 жыл бұрын
Nope u don’t needa download the aws-sdk cuz it’s built in. Make sure u don’t have a typo in the require statement
@kawding_sikul2629
@kawding_sikul2629 2 жыл бұрын
obviously config is not a function its and object which provide update function
@benarcher372
@benarcher372 3 жыл бұрын
Felix, thank you so much for this high quality instruction video. /ben
@FelixYu
@FelixYu 3 жыл бұрын
Glad that it helped 👍
@pragmaticcoder6910
@pragmaticcoder6910 10 ай бұрын
Did you use Node js to write the lambda functions?
@FelixYu
@FelixYu 10 ай бұрын
yes
@rabbyhossain6150
@rabbyhossain6150 2 жыл бұрын
What if services has 100 endpoints? Should one write all the functions in one lambda function? What is the best approach?
@ManumedhaDancingDolls
@ManumedhaDancingDolls Жыл бұрын
Excellent tutorial
@LilyChannel2022
@LilyChannel2022 2 жыл бұрын
Following your method, I'm experiencing CORS issues when calling the API from the browser. The problem exists even though I have set the ENABLE CORS on the API Gateway according to the official website. When the API is associated with lambda, do I need to make a separate CORS setting on the lambda side?
@FelixYu
@FelixYu Жыл бұрын
did u allow CORS in ur lambda function as well??
@LilyChannel2022
@LilyChannel2022 Жыл бұрын
@@FelixYu The CORS problem occurs in the API Gateway, and I think the problem should be solved in the API Gateway. In fact, this CORS problem has been solved by adding judgment to the options method.
@khandoor7228
@khandoor7228 3 жыл бұрын
Just found your channel really looking forward to digging into this. Sub'd
@kidusdesalegn610
@kidusdesalegn610 Жыл бұрын
Thank you it is very helpful
@FelixYu
@FelixYu Жыл бұрын
Glad it was helpful!
@Kuda_Christine
@Kuda_Christine Жыл бұрын
Great video ! Thanks a lot
@FelixYu
@FelixYu Жыл бұрын
glad that u found it helpful!!
@ShubhamBandal
@ShubhamBandal Жыл бұрын
Hi Felix Yu, great video can u share ur website where it explained more, website is not working
@boscarayala8842
@boscarayala8842 3 жыл бұрын
Sir, I am trying to build the API but the AWS API interface is different from what is shown in this video. I did create API but on invoking the methods via postman, lambda function code sends '404 Not Found'. I see that event.httpMethod and event.path are coming out to be NULL. I changed the code to use event.requestContext.http.method, event.requestContext.http.path. I see it working. My Question is, what controls the order of fields when inserting and selecting from dynamodb table; Apparently , the order is different. Thank you for the video.
@FelixYu
@FelixYu 3 жыл бұрын
yea i think the interface in the beginning has changed....i think u might have selected a different api type when u created it. There are 4 options....make sure u select REST API (the lower left one) and u should be able to follow the video as is.
@suchendraharsha1342
@suchendraharsha1342 9 ай бұрын
Why my post method of product is not working and giving configuration error
@mustafafalah8910
@mustafafalah8910 3 жыл бұрын
Wow , keep it up 👍🏻
@rehantayyab82
@rehantayyab82 2 жыл бұрын
I think it's possible to write same lambda function in python as i am beginner in coding Plz reply
@FelixYu
@FelixYu 2 жыл бұрын
kzbin.info/www/bejne/b5armWxqa9aHf80 here is the python version of it
@tuckermiller394
@tuckermiller394 3 жыл бұрын
Wonderful video!
@thetwobluepianos
@thetwobluepianos 2 жыл бұрын
I uploaded your code to my index.js file and created the various methods, however in postman when I try and "post" a product I get: "message": "Internal server error" status 502 bad gateway. Hope someone can answer this!!
@FelixYu
@FelixYu 2 жыл бұрын
That means there’s an error in the lambda function..u can go to cloudwatch and see what the error is
@Omanshuaman
@Omanshuaman Жыл бұрын
@@FelixYu downgrade node 18 to node 16
@arnavanuj
@arnavanuj 2 жыл бұрын
Thank you so much 👌
@khandoor7228
@khandoor7228 3 жыл бұрын
I would like a video on restricting api access!
@FelixYu
@FelixYu 3 жыл бұрын
the video will be out on Friday....be on the lookout for it 👍
@FelixYu
@FelixYu 3 жыл бұрын
the api authentication video is out. check it out kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@khandoor7228
@khandoor7228 3 жыл бұрын
@@FelixYu thanks!
@dotan2211
@dotan2211 3 жыл бұрын
thanks Felix great tutorial, however, I have met some problems when I'm using PATCH method. Following your code, I can update it with number very easily but with string or other data type it is not working and it responses message: "Internal server error". Can you help me with that. Thank you in advance.
@FelixYu
@FelixYu 3 жыл бұрын
that means theres an error in the lambda function. u can go to the lambda console -> monitoring -> view logs on cloudwatch and see what the error is and then fix it accordingly. my guess is u set the dynamodb primary key type to be number (3:03 of the video) and u tried it set it as string, which is now allowed.
@anirup.patnaik
@anirup.patnaik 2 жыл бұрын
amazing video.. loved it
@FelixYu
@FelixYu 2 жыл бұрын
Glad that it’s helpful 👍
@killua3939
@killua3939 3 жыл бұрын
how do you patch multiple updateKeys?
@FelixYu
@FelixYu 3 жыл бұрын
u can modify the method to take in multiple update keys and values in a list in the request body and handle them accordingly..such as { productId: '1001', updateItems: [ { key: 'key1', value: 'value1' }, { key: 'key2', value: 'value2' } ] }
@amithkoutinagaraj5419
@amithkoutinagaraj5419 Жыл бұрын
Hi, Links to Lambda and DynamoDB has expired, can you update those?
@rajpawar4778
@rajpawar4778 2 жыл бұрын
Outstanding buddy.
@FelixYu
@FelixYu 2 жыл бұрын
glad that you found it helpful 👍
@Promotos
@Promotos 3 жыл бұрын
Good stuff
@dipakbhise4779
@dipakbhise4779 2 жыл бұрын
Please make same video with mongodb
@codigofacil53
@codigofacil53 2 жыл бұрын
@Felix Yu. Great work. Congrats !!! When I try to check my API health, I am getting {"message":"Missing Authentication Token"} as a response. Is it possible to point me in the right direction on how to overcome this error, please? Really appreciate your help. Thank you
@FelixYu
@FelixYu 2 жыл бұрын
When u created the api in api gateway, I think u have 4 options in the beginning. Did u choose the REST API option? It’s the lower left corner one
@codigofacil53
@codigofacil53 2 жыл бұрын
@@FelixYu Appreciate your prompt reply. Many thanks. I am not sure. I will do it again and let you know. Again, thank you very much!!!
@shrutipatnaik6759
@shrutipatnaik6759 Жыл бұрын
Hi @Felix Yu , the video was very informative. I tried to replicate the steps as mentioned in your video.But while running the API gateway url in postman I'm getting 502 bad gateway,, can you please help why?
@FelixYu
@FelixYu Жыл бұрын
That means there’s any error in the lambda function. U can check the lambda log and see what it is
@mohammedammaar536
@mohammedammaar536 Жыл бұрын
Were you able to fix the error, please?
@Omanshuaman
@Omanshuaman Жыл бұрын
downgrade node 18 to node 16
@ArjunH-r3y
@ArjunH-r3y Жыл бұрын
@@Omanshuaman may ik how u did?
@danielmarques4997
@danielmarques4997 3 жыл бұрын
Amazing content!
@FelixYu
@FelixYu 3 жыл бұрын
Thanks man!!
@shyampandey7692
@shyampandey7692 3 жыл бұрын
i am getting this type of error what to do region is same that show in your video error is --------->The specific log group: /aws/lambda/serverless-api does not exist in this account or region.
@FelixYu
@FelixYu 3 жыл бұрын
I think u might have forgot to add the cloud watch policy to it. Make sure u add the 2 policies I added in 4:32 of the video
@calebsimmons8539
@calebsimmons8539 2 жыл бұрын
I keep having a problem with validating the preflight request when I use the PATCH method is there something I can do to allow my lambda to respond with what is needed for a preflight request
@ShortErrand
@ShortErrand 3 жыл бұрын
I am getting "message": "Credential should be scoped to a valid region, not 'us-east-1'. " when using GET request for /products API, for authentication I have added the secret and access key in AWS Signature under Postman-> Authorization section. What could be the possible reason? Could you provide your email id for quick response
@FelixYu
@FelixYu 3 жыл бұрын
when u defined ur AWS config in ur lambda code, make sure u set it to the region where ur DynamoDB table is (i think i mistakenly said lambda in the video). refer to 11:28 of the video. let know if that works
@FelixYu
@FelixYu 3 жыл бұрын
also u shouldn't need to include the secret and access key in postman for the API call. it is open to the world by default. if you wanna restrict access to the API, refer this this video for an additional simple step!! kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@DKs_Delight
@DKs_Delight 3 жыл бұрын
Hi Thanks for the tutorial, i tried this, however during postman api testing I only get hello from lambda as a response even when I try to post JSON data to dynamo db
@DKs_Delight
@DKs_Delight 3 жыл бұрын
I figured out the issue, Thanks your content is great. Please make more practical videos on AWS serverless.
@shyampandey7692
@shyampandey7692 3 жыл бұрын
@@DKs_Delight please told me how did you figure it out i am getting the same hello from lambda as response
@vikasgupta8662
@vikasgupta8662 3 жыл бұрын
thankyou for sharing
@blackarc
@blackarc Жыл бұрын
Instead of so many condition checks why not have different lambda function for each api request, segregate the functionality ? Less execution time .
@jainilpatel164
@jainilpatel164 3 жыл бұрын
everything is working fine but when I try to update the data using PATCH the response is "internal server error", I tried everything but it is not working :(
@FelixYu
@FelixYu 3 жыл бұрын
that means there is an error in the lambda function. u can go to the lambda console -> monitoring -> view logs in cloudwatch and then u can see what the error is and fix it accordingly
@ashoklamba4498
@ashoklamba4498 3 жыл бұрын
I am also getting same error in PATCH, DELETE,GET methods in product resource, if you have resolved plzz explain
@jainilpatel164
@jainilpatel164 3 жыл бұрын
@@ashoklamba4498 I had problem with lambda function in the patch section, it was resolved when I corrected the code.
@ashoklamba4498
@ashoklamba4498 3 жыл бұрын
​@@jainilpatel164 Actually i am getting this error in clouwatch logs for all these methods. validationException: The provided key element does not match the schema. @felix yu if u can help that will be great.
@FelixYu
@FelixYu 3 жыл бұрын
@@ashoklamba4498 that means the primary key type u have in ur dynamodb does not match with ur request. im guessing the problem is u have productId as a string set up in dynamodb and in ur request in postman, u pass in a number. try to put a quotation mark around it (e.g., "productId": "123456"). let me know if this resolves the issue!!
@bluesteel1
@bluesteel1 3 жыл бұрын
great video ...
@sapnokasahar3098
@sapnokasahar3098 Жыл бұрын
Can you tell me someone, in this operation where he used IAM role?
@abhisheksakharkar1653
@abhisheksakharkar1653 3 жыл бұрын
the perfect way!!!!!!
@DaleQuaife03
@DaleQuaife03 2 жыл бұрын
Please help. This tutorial is great. However I cannot make POST work. I can add an item directly into my dynamodb table and every single method works except for POST. When I try to add a product with the POST method I get the default 404 error (or null if I remove the unnecessary default case). So for some reason seems as if the POST && PATH case is never met. But I can't figure out why. PLEASE!!!!
@FelixYu
@FelixYu 2 жыл бұрын
Try to get the source code in the description section and start from there and then modify it accordingly. Ur error was prob caused by typos
@DaleQuaife03
@DaleQuaife03 2 жыл бұрын
@@FelixYu thank you for the reply. I did a copy/paste from the provided source code the first time I got the error and it still persisted. However I did manage to get it working. After some Google-Fu I found that redeployment of the API was the fix. My guess is that was needed after editing the code. So it works perfectly now. Thank you again for this tutorial. Super awesome. If you have a video of a way to make this work with a website front-end I'd appreciate the link. Ultimately trying to complete an RSVP section of my wedding website, and want to preload the "contact" form using a unique code for each guest.
@FelixYu
@FelixYu 2 жыл бұрын
@@DaleQuaife03 I have two videos (frontend and backend) where I talked abt how to build an authentication website that may be similar to what you are looking for. check them out: kzbin.info/www/bejne/o5jOmISqgtWfhrs kzbin.info/www/bejne/iJaxnIRmjdCWmdk
@wozskiyeh9651
@wozskiyeh9651 3 жыл бұрын
nice job!
@BeeAttack
@BeeAttack 2 жыл бұрын
Thanks
@rollinOnCode
@rollinOnCode 3 жыл бұрын
How do you restrict it? you use VPC?
@FelixYu
@FelixYu 3 жыл бұрын
i use api keys....check out this video kzbin.info/www/bejne/jF7ElJKQq8l0jZY
@ritusrivastava8391
@ritusrivastava8391 3 жыл бұрын
I'm getting missing authentication token error in postman after doing exact what has been shown. How to fix it?
@FelixYu
@FelixYu 3 жыл бұрын
that means the endpoint is incorrect....make sure u copy the url from the right stage on api gateway and then add /health, /product or products to the end....also make sure u use the right request method on postman (e.g., get , post, etc.)
@ritusrivastava8391
@ritusrivastava8391 3 жыл бұрын
@@FelixYu yeah it worked. i copied wrong url. thanks man!
@sauravverma5281
@sauravverma5281 2 жыл бұрын
I'm getting an error while creating product api.. { "message": "Missing Authentication Token" }
@anelembanga6061
@anelembanga6061 2 жыл бұрын
Im also going through this just now and experiencing the same issue.
@sauravverma471
@sauravverma471 2 жыл бұрын
@@anelembanga6061 have u got with any luck?
API Authentication via API Keys | AWS API Gateway
5:54
Felix Yu
Рет қаралды 70 М.
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 42 МЛН
Serverless Framework with AWS Lambda Crash Course
1:29:11
Laith Academy
Рет қаралды 112 М.
Builty Scraping Platform V2 POC
49:39
Harut Grigoryan's Work Portfolio
Рет қаралды 83
Build a REST API using AWS Lambda and API Gateway
24:12
Jonathan Davies
Рет қаралды 13 М.
I Can't BELIEVE They Let Me in Here!
23:37
Linus Tech Tips
Рет қаралды 421 М.
AWS API Gateway to Lambda Tutorial in Python | Build a HTTP API (2/2)
27:35