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

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2020
  • 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.
    Support the channel plz 😊: www.buymeacoffee.com/felixyu
    Video on API authentication: • API Authentication via...
    Python Version: • [Python] Build a CRUD ...
    Video on Node.js Express API hosted on Elastic Beanstalk: • Build a Node.js Expres...
    Tutorial on how to build a complete serverless register/login system:
    part 1: • API Authentication via...
    part 2: • Build an Authenticatio...
    Learn more about Lambda: jinmeister.com/aws/individual...
    Learn more about DynamoDB: jinmeister.com/aws/individual...
    Lambda code for this tutorial: github.com/felixyu9/serverles...

ความคิดเห็น • 259

  • @FelixYu
    @FelixYu  3 ปีที่แล้ว +22

    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: th-cam.com/video/9eHh946qTIk/w-d-xo.html
    Video on API authentication (a follow-up video): th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html
    Video on Node.js Express API hosted on Elastic Beanstalk: th-cam.com/video/YJvXHr69AHg/w-d-xo.html
    Register/Login system with a serverless API (Part 1): th-cam.com/video/mgkgQtMplPY/w-d-xo.html
    Register/Login system with a serverless API (Part 2): th-cam.com/video/ReNkQ0Xkccw/w-d-xo.html

    • @Yolo-yb1nd
      @Yolo-yb1nd 2 ปีที่แล้ว +1

      I wonder why your comment is not on the top

  • @anelembanga6061
    @anelembanga6061 ปีที่แล้ว

    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.

  • @Kyosune
    @Kyosune 5 หลายเดือนก่อน +2

    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.

  • @garyshank6242
    @garyshank6242 3 ปีที่แล้ว

    Thanks for the video Felix. Please upload more videos on aws covering other services. Love the content.

  • @sergiyrudenko905
    @sergiyrudenko905 ปีที่แล้ว

    Thank you, Felix! Very helpful video!

  • @Culekristo
    @Culekristo 3 ปีที่แล้ว +3

    This was exactly what I needed! Keep it going please!

    • @FelixYu
      @FelixYu  3 ปีที่แล้ว

      Thanks man!!

  • @charlesmcdonald3224
    @charlesmcdonald3224 10 หลายเดือนก่อน

    Excellent demo of a real-world use-case of Lambda with Application Integration.

  • @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 :)

  • @binihalex8097
    @binihalex8097 3 ปีที่แล้ว +1

    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:
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

  • @bugbite-atl
    @bugbite-atl 2 ปีที่แล้ว

    Wow! One of the best tutorials! Great tutorial! Felix! Did thumbs up on the video!

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      glad that it helped :)

  • @VeranikaShapkina
    @VeranikaShapkina 3 ปีที่แล้ว

    extremely useful, and comprehensive video. Thanks!

  • @rockvnme375
    @rockvnme375 2 ปีที่แล้ว

    The best tutorial I have seen. Thanks, Felix Yu

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      glad that it helped 👍

  • @HeyMani92
    @HeyMani92 2 ปีที่แล้ว +2

    Thank you, Felix, clearly explained!

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว +1

      Glad that you found it helpful 👍

  • @craigd8177
    @craigd8177 ปีที่แล้ว

    Great vid man. Keep up the good work.

  • @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!!
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

  • @mayankrathore4700
    @mayankrathore4700 ปีที่แล้ว

    This is amazing! Thanks for putting this up.

    • @FelixYu
      @FelixYu  ปีที่แล้ว

      Glad you enjoyed it!

  • @amirmustafa622
    @amirmustafa622 2 ปีที่แล้ว

    Thank you Felix Yu for amazing video. Your fan now :)

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว +1

      glad that it helped 👍

  • @videos4all-gs5uu
    @videos4all-gs5uu 5 หลายเดือนก่อน +12

    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 5 หลายเดือนก่อน

      thank you so much!! saved me the trouble to try find the error before even appearing xD

    • @elClubdelas7Cifras
      @elClubdelas7Cifras 4 หลายเดือนก่อน +1

      doenst work for me
      still getting 502 bad gateway

    • @SILD90
      @SILD90 3 หลายเดือนก่อน

      @@elClubdelas7Cifras did you fix it? I'm having the same problem

    • @elClubdelas7Cifras
      @elClubdelas7Cifras 3 หลายเดือนก่อน

      @@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 2 หลายเดือนก่อน

      ​@@elClubdelas7Cifras
      Do You wrote in Node js 20x. I have tried but it's not working.

  • @jaykishangrover2437
    @jaykishangrover2437 2 ปีที่แล้ว

    Very Well Explained. Great Work Felix!

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      thank you!!

  • @Ziggy0120
    @Ziggy0120 ปีที่แล้ว

    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!!

  • @AbhishekMishra-uh6du
    @AbhishekMishra-uh6du 2 ปีที่แล้ว

    Thanks for this tutorial!

  • @arokoyuolalekan9912
    @arokoyuolalekan9912 3 ปีที่แล้ว

    This is really nice and easy to understand. Thank you.

  • @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 ปีที่แล้ว +2

      thank you thank you!!!! ill look into these....thanks for the suggestions!!!! 👍

  • @antonarbus
    @antonarbus 2 ปีที่แล้ว +1

    Very appreciate the tutorial, thanks for uploading

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      Glad that you found it helpful 👍

  • @henderstech
    @henderstech 8 หลายเดือนก่อน

    Thank you so much this is just what I needed

  • @ndeepan007
    @ndeepan007 3 ปีที่แล้ว +1

    Expecting more like this

  • @priyamghosh409
    @priyamghosh409 2 ปีที่แล้ว +1

    Thanks a lot Felix.. wonderful explanation :)

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      I am glad that u found it helpful!! 👍

  • @piyushbaral7444
    @piyushbaral7444 3 ปีที่แล้ว

    Tutorial is really helpful. Thanks

  • @riazahmad5975
    @riazahmad5975 ปีที่แล้ว

    bundle of thanks .. really awsome video ..

  • @hustchihieu6546
    @hustchihieu6546 ปีที่แล้ว +1

    this video is very useful. Thank you!

    • @FelixYu
      @FelixYu  ปีที่แล้ว

      Glad that u found it helpful!!

  • @gibo588
    @gibo588 ปีที่แล้ว

    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  ปีที่แล้ว

      Nicee!!

  • @mihirdoshi1262
    @mihirdoshi1262 2 ปีที่แล้ว +1

    Thank you for sharing wonderful content, executed perfectly.

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      Glad that it’s helpful 👍

  • @ManumedhaDancingDolls
    @ManumedhaDancingDolls 9 หลายเดือนก่อน

    Excellent tutorial

  • @itskudaa
    @itskudaa ปีที่แล้ว

    Great video !
    Thanks a lot

    • @FelixYu
      @FelixYu  ปีที่แล้ว

      glad that u found it helpful!!

  • @chidokaemeka1878
    @chidokaemeka1878 2 ปีที่แล้ว +1

    Best Serverless API tutorial

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      Thank you :)

  • @tuckermiller394
    @tuckermiller394 2 ปีที่แล้ว

    Wonderful video!

  • @ANKURKUMAR-pq7fb
    @ANKURKUMAR-pq7fb 2 ปีที่แล้ว

    Thanks a lot for this wonderful video.

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      glad that u found it helpful!! 👍

  • @mustafafalah8910
    @mustafafalah8910 3 ปีที่แล้ว

    Wow , keep it up 👍🏻

  • @checktheprojection
    @checktheprojection 2 ปีที่แล้ว

    Best api tutorial ever ! Would appreciate if you can add Cognito in a new tutorial :)

  • @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 👍

  • @joshb.9380
    @joshb.9380 3 ปีที่แล้ว +1

    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
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

  • @arnavanuj
    @arnavanuj 2 ปีที่แล้ว

    Thank you so much 👌

  • @nimrafatima5119
    @nimrafatima5119 2 ปีที่แล้ว +1

    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: th-cam.com/video/9eHh946qTIk/w-d-xo.html

  • @benarcher372
    @benarcher372 3 ปีที่แล้ว

    Felix, thank you so much for this high quality instruction video. /ben

    • @FelixYu
      @FelixYu  3 ปีที่แล้ว

      Glad that it helped 👍

  • @rajpawar4778
    @rajpawar4778 2 ปีที่แล้ว

    Outstanding buddy.

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      glad that you found it helpful 👍

  • @kidusdesalegn610
    @kidusdesalegn610 ปีที่แล้ว

    Thank you it is very helpful

    • @FelixYu
      @FelixYu  ปีที่แล้ว

      Glad it was helpful!

  • @wozskiyeh9651
    @wozskiyeh9651 3 ปีที่แล้ว

    nice job!

  • @danielmarques4997
    @danielmarques4997 3 ปีที่แล้ว

    Amazing content!

    • @FelixYu
      @FelixYu  3 ปีที่แล้ว

      Thanks man!!

  • @anirup.patnaik
    @anirup.patnaik 2 ปีที่แล้ว

    amazing video.. loved it

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      Glad that it’s helpful 👍

  • @Promotos
    @Promotos 3 ปีที่แล้ว +1

    Good stuff

  • @russooneateseven
    @russooneateseven 3 ปีที่แล้ว +1

    after reading a bunch of how to's and getting confused, this was a great step by step tutorial to watch

    • @FelixYu
      @FelixYu  3 ปีที่แล้ว +1

      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:
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

    • @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 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

      @@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!!!!

  • @harshalsuryawanshi8896
    @harshalsuryawanshi8896 2 ปีที่แล้ว +5

    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.

  • @grassrootsdefi7522
    @grassrootsdefi7522 2 ปีที่แล้ว

    Felix: Your work here is outstanding. Check out the API Keys lesson in the description!

  • @mairajahus
    @mairajahus ปีที่แล้ว +2

    Where I can get the code which you written during build up API gate?

  • @bluesteel1
    @bluesteel1 2 ปีที่แล้ว

    great video ...

  • @vikasgupta8662
    @vikasgupta8662 2 ปีที่แล้ว

    thankyou for sharing

  • @thaophuong-jo9bn
    @thaophuong-jo9bn 10 หลายเดือนก่อน

    @FlixYu do you often use console in your work?

  • @MMeffert
    @MMeffert 2 ปีที่แล้ว

    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.

  • @BeeAttack
    @BeeAttack ปีที่แล้ว +1

    Thanks

  • @abhaythakur8572
    @abhaythakur8572 2 ปีที่แล้ว

    good one

  • @gaganganapathy9271
    @gaganganapathy9271 3 หลายเดือนก่อน

    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?

  • @vil3n80
    @vil3n80 9 หลายเดือนก่อน +4

    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"

  • @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

  • @sdlfkorg
    @sdlfkorg ปีที่แล้ว

    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  ปีที่แล้ว

      th-cam.com/video/AmHZxULclLQ/w-d-xo.html
      I have a diff video that talks abt how to integrate lambda with github. Check it out

  • @rabbyhossain6150
    @rabbyhossain6150 2 ปีที่แล้ว

    What if services has 100 endpoints? Should one write all the functions in one lambda function? What is the best approach?

  • @abhisheksakharkar1653
    @abhisheksakharkar1653 3 ปีที่แล้ว +1

    the perfect way!!!!!!

  • @sapnokasahar3098
    @sapnokasahar3098 ปีที่แล้ว

    Can you tell me someone, in this operation where he used IAM role?

  • @YuvalDavid-mi7sn
    @YuvalDavid-mi7sn ปีที่แล้ว

    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  ปีที่แล้ว

      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 ปีที่แล้ว

      obviously config is not a function its and object which provide update function

  • @ShubhamBandal
    @ShubhamBandal ปีที่แล้ว

    Hi Felix Yu, great video can u share ur website where it explained more, website is not working

  • @LilyChannel2022
    @LilyChannel2022 ปีที่แล้ว

    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.

  • @navjotsingh2457
    @navjotsingh2457 11 หลายเดือนก่อน

    tysm

  • @suchendraharsha1342
    @suchendraharsha1342 5 หลายเดือนก่อน

    Why my post method of product is not working and giving configuration error

  • @khandoor7228
    @khandoor7228 3 ปีที่แล้ว +1

    Just found your channel really looking forward to digging into this. Sub'd

  • @amithkoutinagaraj5419
    @amithkoutinagaraj5419 ปีที่แล้ว

    Hi,
    Links to Lambda and DynamoDB has expired, can you update those?

  • @vishvahkannan1097
    @vishvahkannan1097 ปีที่แล้ว +1

    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

  • @m0bs6
    @m0bs6 10 หลายเดือนก่อน

    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  9 หลายเดือนก่อน +1

      glad that u found it helpful!!

  • @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):
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

  • @yukimister87
    @yukimister87 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      @@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  2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว

      @@FelixYu Many Thanks Felix !

  • @saikiranvarala5072
    @saikiranvarala5072 ปีที่แล้ว +1

    Is that good practice to create all crud operations in single lambda function?

  • @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 ปีที่แล้ว +1

      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.

  • @rohinikumari3077
    @rohinikumari3077 10 หลายเดือนก่อน +2

    I'm getting 502 bad gateway. Unable to resolve this issue. Please help

    • @uditpandya3836
      @uditpandya3836 10 หลายเดือนก่อน

      Check your CloudWatch logs to debug. For me, it was silly ES6 module export error.

  • @thetwobluepianos
    @thetwobluepianos 2 ปีที่แล้ว +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

  • @cheyezamlondo7933
    @cheyezamlondo7933 2 ปีที่แล้ว +3

    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 ปีที่แล้ว +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

  • @pragmaticcoder6910
    @pragmaticcoder6910 6 หลายเดือนก่อน

    Did you use Node js to write the lambda functions?

    • @FelixYu
      @FelixYu  6 หลายเดือนก่อน +1

      yes

  • @boscarayala8842
    @boscarayala8842 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      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.

  • @arbazahmed1060
    @arbazahmed1060 2 ปีที่แล้ว +8

    Guys who ever getting *internal server error* change region in code

    • @shivamsharma-kk3yh
      @shivamsharma-kk3yh ปีที่แล้ว

      make sure proxy lambda integration is checked while creating resource and method in API Gateway

  • @kawding_sikul2629
    @kawding_sikul2629 ปีที่แล้ว

    you deserve sub.. then i did

  • @dipakbhise4779
    @dipakbhise4779 2 ปีที่แล้ว +1

    Please make same video with mongodb

  • @Divakar_Kashyap
    @Divakar_Kashyap 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

    • @Divakar_Kashyap
      @Divakar_Kashyap 3 ปีที่แล้ว

      I figured out the issue, Thanks your content is great. Please make more practical videos on AWS serverless.

    • @shyampandey7692
      @shyampandey7692 3 ปีที่แล้ว

      @@Divakar_Kashyap please told me how did you figure it out i am getting the same hello from lambda as response

  • @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

    • @user-sx5hm1tb6y
      @user-sx5hm1tb6y ปีที่แล้ว

      @@Omanshuaman may ik how u did?

  • @killua3939
    @killua3939 3 ปีที่แล้ว +1

    how do you patch multiple updateKeys?

    • @FelixYu
      @FelixYu  3 ปีที่แล้ว +1

      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'
      }
      ]
      }

  • @elClubdelas7Cifras
    @elClubdelas7Cifras 4 หลายเดือนก่อน

    done

  • @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!!
      th-cam.com/video/V-ac_ZvdAW4/w-d-xo.html

  • @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

  • @nickschmitt8594
    @nickschmitt8594 2 ปีที่แล้ว +2

    why not a lambda for each HTTP method?

    • @paulwolff6405
      @paulwolff6405 2 ปีที่แล้ว +1

      I am wondering about this too. This breaks the single responsibility principle doesn’t it?

  • @blackarc
    @blackarc ปีที่แล้ว

    Instead of so many condition checks why not have different lambda function for each api request, segregate the functionality ? Less execution time .

  • @rehantayyab82
    @rehantayyab82 2 ปีที่แล้ว +1

    I think it's possible to write same lambda function in python as i am beginner in coding
    Plz reply

    • @FelixYu
      @FelixYu  2 ปีที่แล้ว

      th-cam.com/video/9eHh946qTIk/w-d-xo.html
      here is the python version of it

  • @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 ปีที่แล้ว +1

      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!!!

  • @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 ปีที่แล้ว +1

      @@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:
      th-cam.com/video/mgkgQtMplPY/w-d-xo.html
      th-cam.com/video/ReNkQ0Xkccw/w-d-xo.html

  • @kavitalokhande3166
    @kavitalokhande3166 ปีที่แล้ว

    Can you create file upload api using nodejs serverless daynomadb,I have urjunt requirment

    • @claydaman22
      @claydaman22 11 หลายเดือนก่อน

      If you are uploading to a S3 bucket, then I would use pre sign urls. Setup an endpoint to a lambda that can create a pre sign url and return to the client, and then use that url to upload the file direct to the S3. With this method you can bypass the file size limits that lambda and api gateway have.