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

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

Комментарии • 259

  • @FelixYu
    @FelixYu  3 года назад +23

    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: ruclips.net/video/9eHh946qTIk/видео.html
    Video on API authentication (a follow-up video): ruclips.net/video/V-ac_ZvdAW4/видео.html
    Video on Node.js Express API hosted on Elastic Beanstalk: ruclips.net/video/YJvXHr69AHg/видео.html
    Register/Login system with a serverless API (Part 1): ruclips.net/video/mgkgQtMplPY/видео.html
    Register/Login system with a serverless API (Part 2): ruclips.net/video/ReNkQ0Xkccw/видео.html

    • @Yolo-yb1nd
      @Yolo-yb1nd 3 года назад +1

      I wonder why your comment is not on the top

  • @videos4all-gs5uu
    @videos4all-gs5uu 10 месяцев назад +15

    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 10 месяцев назад

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

    • @elClubdelas7Cifras
      @elClubdelas7Cifras 9 месяцев назад +1

      doenst work for me
      still getting 502 bad gateway

    • @SILD90
      @SILD90 8 месяцев назад

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

    • @elClubdelas7Cifras
      @elClubdelas7Cifras 8 месяцев назад

      @@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 7 месяцев назад

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

  • @Kyosune
    @Kyosune 10 месяцев назад +3

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

  • @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  2 года назад

      Glad that u found it 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.

  • @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:
      ruclips.net/video/V-ac_ZvdAW4/видео.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!!!!

  • @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:
      ruclips.net/video/V-ac_ZvdAW4/видео.html

  • @vil3n80
    @vil3n80 Год назад +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"

  • @charlesmcdonald3224
    @charlesmcdonald3224 Год назад

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

  • @Culekristo
    @Culekristo 3 года назад +3

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

    • @FelixYu
      @FelixYu  3 года назад

      Thanks man!!

  • @garyshank6242
    @garyshank6242 3 года назад

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

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

  • @chidokaemeka1878
    @chidokaemeka1878 3 года назад +1

    Best Serverless API tutorial

    • @FelixYu
      @FelixYu  3 года назад

      Thank you :)

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

  • @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
      ruclips.net/video/V-ac_ZvdAW4/видео.html

  • @rockvnme375
    @rockvnme375 3 года назад

    The best tutorial I have seen. Thanks, Felix Yu

    • @FelixYu
      @FelixYu  3 года назад

      glad that it helped 👍

  • @HeyMani92
    @HeyMani92 2 года назад +2

    Thank you, Felix, clearly explained!

    • @FelixYu
      @FelixYu  2 года назад +1

      Glad that you found it helpful 👍

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

  • @anilthirunagari3618
    @anilthirunagari3618 3 года назад

    Really appreciate your work, I was looking for the exact tutorial.
    Looking forward for authentication

    • @FelixYu
      @FelixYu  3 года назад

      thank you. here is the authentication video. check it out!!
      ruclips.net/video/V-ac_ZvdAW4/видео.html

  • @ndeepan007
    @ndeepan007 3 года назад +1

    Expecting more like this

  • @nimrafatima5119
    @nimrafatima5119 3 года назад +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  3 года назад

      here is the python version video: ruclips.net/video/9eHh946qTIk/видео.html

  • @VeranikaShapkina
    @VeranikaShapkina 3 года назад

    extremely useful, and comprehensive video. Thanks!

  • @jaykishangrover2437
    @jaykishangrover2437 2 года назад

    Very Well Explained. Great Work Felix!

  • @mairajahus
    @mairajahus 2 года назад +2

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

  • @amirmustafa622
    @amirmustafa622 3 года назад

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

    • @FelixYu
      @FelixYu  3 года назад +1

      glad that it helped 👍

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

  • @antonarbus
    @antonarbus 2 года назад +1

    Very appreciate the tutorial, thanks for uploading

    • @FelixYu
      @FelixYu  2 года назад

      Glad that you found it helpful 👍

  • @sergiyrudenko905
    @sergiyrudenko905 Год назад

    Thank you, Felix! Very helpful video!

  • @arokoyuolalekan9912
    @arokoyuolalekan9912 3 года назад

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

  • @grassrootsdefi7522
    @grassrootsdefi7522 3 года назад

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

  • @mihirdoshi1262
    @mihirdoshi1262 2 года назад +1

    Thank you for sharing wonderful content, executed perfectly.

    • @FelixYu
      @FelixYu  2 года назад

      Glad that it’s helpful 👍

  • @craigd8177
    @craigd8177 Год назад

    Great vid man. Keep up the good work.

  • @priyamghosh409
    @priyamghosh409 2 года назад +1

    Thanks a lot Felix.. wonderful explanation :)

    • @FelixYu
      @FelixYu  2 года назад

      I am glad that u found it helpful!! 👍

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

  • @mayankrathore4700
    @mayankrathore4700 2 года назад

    This is amazing! Thanks for putting this up.

    • @FelixYu
      @FelixYu  Год назад

      Glad you enjoyed it!

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

  • @gaganganapathy9271
    @gaganganapathy9271 8 месяцев назад

    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?

  • @rohinikumari3077
    @rohinikumari3077 Год назад +2

    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.

  • @checktheprojection
    @checktheprojection 3 года назад

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

  • @hustchihieu6546
    @hustchihieu6546 2 года назад +1

    this video is very useful. Thank you!

    • @FelixYu
      @FelixYu  2 года назад

      Glad that u found it helpful!!

  • @mustafafalah8910
    @mustafafalah8910 3 года назад

    Wow , keep it up 👍🏻

  • @piyushbaral7444
    @piyushbaral7444 3 года назад

    Tutorial is really helpful. Thanks

  • @riazahmad5975
    @riazahmad5975 2 года назад

    bundle of thanks .. really awsome video ..

  • @vishvahkannan1097
    @vishvahkannan1097 2 года назад +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

  • @arbazahmed1060
    @arbazahmed1060 2 года назад +8

    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

  • @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 года назад

      ruclips.net/video/AmHZxULclLQ/видео.html
      I have a diff video that talks abt how to integrate lambda with github. Check it out

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

  • @henderstech
    @henderstech Год назад

    Thank you so much this is just what I needed

  • @thaophuong-jo9bn
    @thaophuong-jo9bn Год назад

    @FlixYu do you often use console in your work?

  • @rabbyhossain6150
    @rabbyhossain6150 2 года назад

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

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

  • @AbhishekMishra-uh6du
    @AbhishekMishra-uh6du 3 года назад

    Thanks for this tutorial!

  • @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  Год назад +1

      glad that u found it helpful!!

  • @jainilpatel164
    @jainilpatel164 3 года назад +1

    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 года назад +1

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

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

  • @suchendraharsha1342
    @suchendraharsha1342 10 месяцев назад

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

  • @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  2 года назад

      did u allow CORS in ur lambda function as well??

    • @LilyChannel2022
      @LilyChannel2022 2 года назад

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

  • @sauravverma5281
    @sauravverma5281 2 года назад +1

    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?

  • @nickschmitt8594
    @nickschmitt8594 3 года назад +2

    why not a lambda for each HTTP method?

    • @paulwolff6405
      @paulwolff6405 3 года назад +1

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

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

  • @saikiranvarala5072
    @saikiranvarala5072 Год назад +1

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

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

  • @rajpawar4778
    @rajpawar4778 2 года назад

    Outstanding buddy.

    • @FelixYu
      @FelixYu  2 года назад

      glad that you found it helpful 👍

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

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

  • @tuckermiller394
    @tuckermiller394 3 года назад

    Wonderful video!

  • @ANKURKUMAR-pq7fb
    @ANKURKUMAR-pq7fb 2 года назад

    Thanks a lot for this wonderful video.

    • @FelixYu
      @FelixYu  2 года назад

      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

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

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

  • @anirup.patnaik
    @anirup.patnaik 2 года назад

    amazing video.. loved it

    • @FelixYu
      @FelixYu  2 года назад

      Glad that it’s helpful 👍

  • @sapnokasahar3098
    @sapnokasahar3098 Год назад

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

  • @benarcher372
    @benarcher372 3 года назад

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

    • @FelixYu
      @FelixYu  3 года назад

      Glad that it helped 👍

  • @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):
      ruclips.net/video/V-ac_ZvdAW4/видео.html

  • @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:
      ruclips.net/video/mgkgQtMplPY/видео.html
      ruclips.net/video/ReNkQ0Xkccw/видео.html

  • @danielmarques4997
    @danielmarques4997 3 года назад

    Amazing content!

    • @FelixYu
      @FelixYu  3 года назад

      Thanks man!!

  • @shrutipatnaik6759
    @shrutipatnaik6759 2 года назад

    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  2 года назад

      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?

  • @Promotos
    @Promotos 3 года назад +1

    Good stuff

  • @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 года назад +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!

  • @ManumedhaDancingDolls
    @ManumedhaDancingDolls Год назад

    Excellent tutorial

  • @lyooo7362
    @lyooo7362 Год назад

    No matter what I try to do, I keep receiving a 502 Bad gateway with a "Internal server error" message even when I put the code from the video in my lambda :/
    (tried switching to node 16 and no change either)
    Does someone know how to fix it ?
    Thanks

    • @iskusstvoa6209
      @iskusstvoa6209 Год назад

      are you have answer?

    • @cesarzapata24
      @cesarzapata24 Год назад

      I fix this error, in my case you have to change the region variable at the beggining of the code.

    • @m0bs6
      @m0bs6 Год назад

      got same error

    • @m0bs6
      @m0bs6 Год назад

      @@cesarzapata24 already tried but no luck

    • @ogcontraband
      @ogcontraband Год назад

      This AWS Dynamo Lamdba stuff is complete dogshit even amazon's own code samples don't work

  • @amithkoutinagaraj5419
    @amithkoutinagaraj5419 Год назад

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

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

  • @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!!
      ruclips.net/video/V-ac_ZvdAW4/видео.html

  • @pragmaticcoder6910
    @pragmaticcoder6910 11 месяцев назад

    Did you use Node js to write the lambda functions?

    • @FelixYu
      @FelixYu  11 месяцев назад +1

      yes

  • @Kuda_Christine
    @Kuda_Christine Год назад

    Great video !
    Thanks a lot

    • @FelixYu
      @FelixYu  Год назад

      glad that u found it helpful!!

  • @blackarc
    @blackarc 2 года назад

    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 года назад

      ruclips.net/video/9eHh946qTIk/видео.html
      here is the python version of it

  • @johnfu2700
    @johnfu2700 3 года назад

    I keep getting a 502 bad gateway Internal Server Error. And I did this twice, I must have made the same mistake twice some where.

    • @FelixYu
      @FelixYu  3 года назад +1

      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

  • @cheyezamlondo6033
    @cheyezamlondo6033 2 года назад

    How do I write the code in line number 102? I am getting an error, please help me

    • @FelixYu
      @FelixYu  2 года назад +2

      here is the source code for the lambda function. try to copy that and modify it accordingly:
      github.com/felixyu9/serverless-api-tutorial-code/blob/main/index.js

    • @cheyezamlondo6033
      @cheyezamlondo6033 2 года назад +1

      Thank you so much

  • @khandoor7228
    @khandoor7228 3 года назад +1

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

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

  • @kidusdesalegn610
    @kidusdesalegn610 2 года назад

    Thank you it is very helpful

    • @FelixYu
      @FelixYu  Год назад

      Glad it was helpful!

  • @bluesteel1
    @bluesteel1 3 года назад

    great video ...

  • @manasan3208
    @manasan3208 3 года назад

    Felix, thank you it's really wonderful. How can i get the code, can you pls create a repo, it will be helpful

    • @FelixYu
      @FelixYu  3 года назад +1

      here is the source code: github.com/felixyu9/serverless-api-tutorial-code/blob/main/index.js

    • @manasan3208
      @manasan3208 3 года назад

      @@FelixYu Thanks for short reply

  • @kavitalokhande3166
    @kavitalokhande3166 Год назад

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

    • @claydaman22
      @claydaman22 Год назад

      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.

  • @riazahmad5975
    @riazahmad5975 2 года назад

    how to update multiple attribute in same query ? please

    • @FelixYu
      @FelixYu  2 года назад

      u can pass in an object that contains key value pairs that u wanna update. for example:
      {
      "price": 20,
      "color": "black",
      "somethingElse": 100
      }
      and then in ur lambda function u can have a for loop to go thru each one to construct the query string: set price=:value1, color=:value2, somethingElse=:value3
      and then in ur ExpressionAttributeValues, u define :value1, :value2, value3 as 20, "black" and 100, respectively

  • @wozskiyeh9651
    @wozskiyeh9651 3 года назад

    nice job!

  • @arnavanuj
    @arnavanuj 3 года назад

    Thank you so much 👌