AWS API Gateway to Lambda Tutorial in Python | Build a HTTP API (2/2)

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

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

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

    Looking to become an expert on AWS Lambda? Check out my new course: AWS Lambda - A Practical Guide
    www.udemy.com/course/aws-lambda-a-practical-guide/?referralCode=F6D1A50467E579C65372

  • @opensiembro7331
    @opensiembro7331 3 года назад +15

    This series should not stop here. I hope you can continue adding more stuff to this demo

  • @justinschoen6656
    @justinschoen6656 3 года назад +9

    this was so helpful. watching a knowledgeable person on this topic reason through creating an API and then testing it solidified a lot of concepts I had been fumbling around with. great video!

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

      Thanks so much Justin! Your kind words really mean a lot. Take care!

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

    Thank you for this post. I have been having trouble getting my first AWS API working and this helped me get through it.

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

    oMg (camel case, you just taught me that lol)... Hey, thanks so much for all your videos. Soooooooo useful and helpful. You usually answer 3 to 8 burning questions I have in every single one of your videos. Fantastic stuff!

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

    Great Demo of Lamda and API Gateway Integration for Newbies ... Thanks a Lot !

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

    This is good stuff. I have been trying to wrap my head around some concepts , watching this video made it crystal clear.

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

    AH MAN THANK YOU FOR THIS.
    I wasnt even getting logs from cloudwatch, my lambda is in a container.
    Wouldnt have done it without u.

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

    thanks alot man, all the other videos i found were either outdated or skipped fundamental steps. was very helpful

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

    Nice!!! The train of thought is so logical and simplistic !!

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

    Awesome! Best tutorial I've seen so far

  • @codeblooded6760
    @codeblooded6760 14 дней назад

    This is Gold. Just Beautiful❤

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

    Great work bro...better than paid courses

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

    Excellent video! Super helpful and informative. I'd try to go ahead of the video, hit an error, then start the video and you'd explain exactly how to fix it lol.

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

      Hi John,
      Going ahead of the video is a great way to learn! I'm glad you found the video helpful and thank you for your kind words!
      Daniel

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

    This is incredibly useful. Thank you very much for taking your time and energy to create this tutorial!

  • @Victor-yo9rz
    @Victor-yo9rz 3 года назад +1

    It was very useful, big thanks to you, first RUclips lesson I'd like to share with someone :)

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

      Thanks so much Victor! Really appreciate the kind words. Take care!

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

    Absolutely awesome vid. You're the man! 👍

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

    worked for me, could never thank you enough.

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

    Really useful and great video. Thank you for sharing!

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

    really in depth and good tutorial, thank you for posting.

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

    I love this video! Thanks a lot, Daniel, you are a great teacher

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

    This was an awesome explanatory video! Helped me a LOT to get up to speed!

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

    This was so helpful. Absolutely amazing thank you!

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

    Thank you so much for putting so much effort into making this video for us :)

  • @SoyJavero
    @SoyJavero 3 месяца назад

    Thanks for sharing JSON formatter and validator

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

    Great explanation of things. Thank you!

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

    This was a great video and very helpful

  • @MohanDas-ne4ci
    @MohanDas-ne4ci Год назад

    Thank you for the clear explanation!

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

    Awesome. Just the video I needed. Thanks!

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

    Great tutorial mate. Thank you.

  • @3083mann
    @3083mann 3 года назад +1

    A very succinct demo. Thanks!👍

  • @poonam-kamboj
    @poonam-kamboj 3 года назад +1

    very nice explanation

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

    Superb tutorial!

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

    Great Video! Thank you.

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

    Thank you so much for this amazing training!!

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

    You are the best!

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

    awesome lesson.

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

    Hello. Many thanks. It helps me a lot !

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

    Good starting point...

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

    Thanks. Great video.

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

    thanks...
    Wish it was more up to date.

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

    Fantastic! Thanx

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

    Thanks for the video. Quick questions: why we use API gateway? any benefit? could we just expose the lambda API to the public internet and calling?

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

    Bro videos are good, please build a complete microservice from scratch end to end

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

    Thank you so much!

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

    awesome tutorial man, really really appreciated!
    also, where can I get that fancy hand cursor of yours? 🙂

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

    15:20 - FYI you could also just paste your json into JSON.parse() in the chrome console

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

    Hi, are you able to provide a tutorial how to automate services when a latest image is push to ECR, EventBridge or Lambda will be invoked and triggered to deploy or force new deployment in ECS.

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

    Hi Better Dev,
    Thank you so much for your great videos and well-articulated teaching style. I have been watching your "AWS API Gateway" and following along with hands-on exercises.
    I received the following message from Postman: "message": "Internal Server Message".
    I also received the following message from my CloudWatch logs:
    [ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'lambda_function': expected an indented block (lambda_function.py, line 16)
    Traceback (most recent call last):
    File "/var/task/lambda_function.py" Line 16
    elif event['rawPath'] == CREATE_RAW_PATH:
    In my function code on Lambda, I have adjusted this indented issue many times but get the error message. Please kindly advise. What am I doing wrong? Thank you!

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

      Hi there, this looks like a code format problem. I would try to run your code through some kind of code validator. Hope this helps.

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

    Why did you still need to deploy the API manually whenever you made a change even though you had auto deploy enabled?

  • @dokst-b9s
    @dokst-b9s Год назад

    my logs do not show "version 2.0 routekey - all they show is start initstart and end - have no idea what is being passed in.

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

    can you make detail video on redshift also

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

    how to get to that page on post man? that's a new tool and once I downloaded it, it doesn't show the same thing as you have

  • @AlvinC-sz3li
    @AlvinC-sz3li 3 года назад

    Do you have any videos for consuming Kinesis inside ECS? We have some Kinesis triggered job that could last for more than 15min, so we cannot use Lambda. However, it seems like consuming Kinesis without Lambda is very complicated, need to use the Kinesis Client Library and handle shard myself, and also requires a job status ddb table. Thanks.

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

    (1) So I used aws to upload image directly from front end(html) to s3
    ps: (its up and running)
    (2) and I have a python code that uses aws rekognition to recognise the image attributes.
    (3) now my question here is how can I run my image recognition python code by pressing on a html button that I have to insert in the (1)'s page that i made ?

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

    When should you actually use API gateway with Lambda? I mean if i want a full fledged webapp then its probably better to use a web server instead? Which cases would lambda+api gateway be better than a webserver

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

      Hi there,
      I think this video does a good job of answering your question: ruclips.net/video/e8Vh9-hsRBo/видео.html
      Thanks!

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

      @@BeABetterDev Yeah I've been binge watching your videos and watched that one. Thanks! You have the best aws content on RUclips atleast for beginners. Subscribed and recommended to all my friends.

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

    I used form data for my fast api and flask

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

    Can we have any video where lambda function is using Aurora ?

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

      Hi Moyed, check out my video on Lambda + Aurora here: ruclips.net/video/W-tzoGYMfTA/видео.html

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

    I get internal server errors when I call the routes....

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

    está super chévere

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

    I used Curl to test mine.

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

    For post call it showed
    \t because you selected text instead of Json for payload in postman

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

    for anyone getting an error on the Post request, make sure to capitalize the "N" in firstName (it is lowercase in the attached code, causing an internal error)

  • @Tt-wm1ze
    @Tt-wm1ze 3 года назад

    hi how would do it with a image ? do you have a email adress??

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

    Great tutorial! It looks like HTTP API can invoke Kinesis as well. By any chance, do you have a tutorial for that as well?

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

      Thanks Moemi! Unfortunately no video on that yet, but maybe soon!

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

    There are some logical issues with this: What happens if you're trying to get the value of a key from the "event" dictionary, but it doesn't exist because the API call didn't include that parameter? How can we set a default value for the API parameters?

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

      Hi there,
      You would need to have some basic event validation logic to ensure all expected fields are non-null. This was just a toy example to show how the end to end flow works, but in a real application I would absolutely add validation logic.
      Hope this helps

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

      @@BeABetterDev thanks! I ended up using python's setdefault() function for dictionaries to add default fields to the event dict.

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

    Thanks. I ddnt realize the queryStringParamete stuff while I was building my API. Wasted several hours on this :(

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

    How to make instagram api to get user details profilepic, full_name,etc

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

    I followed exact steps although I'm getting "Internal Server Error" when accessing my API :(

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

      Hi, can you check your cloudwatch logs to see what the error is? There is probably an error in your lambda function itself.

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

      @@BeABetterDev Hi! Thanks for your reply! No any error has been logged. I use my own lambda (not the that is being shown in the video) on which I am returning a valid object type.
      ibb.co/NSbYRzN

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

      Hi Angelos,
      Ah, I think I see the problem. Your response needs to be a well formatted one with a status code of 200 OK to indicate the invocation was successful to API gateway. You can encode the payload in the body field of your response.
      It needs to look something like this:
      response = {
      statusCode: 200,
      body: JSON.stringify(yourDataHere)
      };

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

      @@BeABetterDev Hello! Yes, I though that too and already tried it although the issue remains

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

      Did you find the problem?

  • @kameswariaparnamantravadi
    @kameswariaparnamantravadi 7 месяцев назад

    "errorMessage": "'rawPath'",
    "errorType": "KeyError",
    is the error message

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

    I followed all the exact steps but I am getting "Internal server error" during the third stage of this tutorial. When checking the logs I get:
    [ERROR] JSONDecodeError: Expecting ':' delimiter: line 3 column 17 (char 45)
    Traceback (most recent call last):
    File "/var/task/lambda_function.py", line 19, in lambda_handler
    decodedEvent = json.loads(event['body'])
    File "/var/lang/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
    File "/var/lang/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/var/lang/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)

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

      I ran the code through a various ptyhon syntax checkers, and theres no issue with the syntax. What am I missing here?

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

      Found the issue... there was a syntax error in the body of my POST in postman. :D

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

      Glad you figured it out!