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
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!
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!
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.
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.
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!
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.
(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 ?
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 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.
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)
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?
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
@@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
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) };
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)
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
This series should not stop here. I hope you can continue adding more stuff to this demo
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!
Thanks so much Justin! Your kind words really mean a lot. Take care!
Thank you for this post. I have been having trouble getting my first AWS API working and this helped me get through it.
Glad I could help!
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!
youreWelcome!
Great Demo of Lamda and API Gateway Integration for Newbies ... Thanks a Lot !
Very welcome!
This is good stuff. I have been trying to wrap my head around some concepts , watching this video made it crystal clear.
Glad it was helpful!
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.
Glad I could help Leandro!
thanks alot man, all the other videos i found were either outdated or skipped fundamental steps. was very helpful
Nice!!! The train of thought is so logical and simplistic !!
Thanks Prashant!
Awesome! Best tutorial I've seen so far
This is Gold. Just Beautiful❤
Great work bro...better than paid courses
Thank you so much !
@@BeABetterDev Always waiting for new AWS tutorial
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.
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
This is incredibly useful. Thank you very much for taking your time and energy to create this tutorial!
It was very useful, big thanks to you, first RUclips lesson I'd like to share with someone :)
Thanks so much Victor! Really appreciate the kind words. Take care!
Absolutely awesome vid. You're the man! 👍
You're very welcome!
worked for me, could never thank you enough.
You're welcome!
Really useful and great video. Thank you for sharing!
Glad it was helpful!
really in depth and good tutorial, thank you for posting.
I love this video! Thanks a lot, Daniel, you are a great teacher
This was an awesome explanatory video! Helped me a LOT to get up to speed!
This was so helpful. Absolutely amazing thank you!
You're so welcome!
Thank you so much for putting so much effort into making this video for us :)
You're very welcome Subha!
Thanks for sharing JSON formatter and validator
Great explanation of things. Thank you!
You're very welcome Nick!
This was a great video and very helpful
You're very welcome!
Thank you for the clear explanation!
Awesome. Just the video I needed. Thanks!
Great tutorial mate. Thank you.
Glad it helped!
A very succinct demo. Thanks!👍
You're very welcome Manish!
very nice explanation
Youre very welcome Poonam!
Superb tutorial!
Great Video! Thank you.
Thank you so much for this amazing training!!
You are the best!
awesome lesson.
Thank you!
Hello. Many thanks. It helps me a lot !
Good starting point...
Thanks. Great video.
thanks...
Wish it was more up to date.
Fantastic! Thanx
You're very welcome!
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?
Bro videos are good, please build a complete microservice from scratch end to end
Thank you so much!
You're welcome Manish!
awesome tutorial man, really really appreciated!
also, where can I get that fancy hand cursor of yours? 🙂
15:20 - FYI you could also just paste your json into JSON.parse() in the chrome console
Great tip, thank you!
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.
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!
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.
Why did you still need to deploy the API manually whenever you made a change even though you had auto deploy enabled?
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.
can you make detail video on redshift also
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
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.
(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 ?
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
Hi there,
I think this video does a good job of answering your question: ruclips.net/video/e8Vh9-hsRBo/видео.html
Thanks!
@@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.
I used form data for my fast api and flask
Can we have any video where lambda function is using Aurora ?
Hi Moyed, check out my video on Lambda + Aurora here: ruclips.net/video/W-tzoGYMfTA/видео.html
I get internal server errors when I call the routes....
está super chévere
I used Curl to test mine.
For post call it showed
\t because you selected text instead of Json for payload in postman
Thanks!
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)
hi how would do it with a image ? do you have a email adress??
You'd probably use S3 to store the image.
Great tutorial! It looks like HTTP API can invoke Kinesis as well. By any chance, do you have a tutorial for that as well?
Thanks Moemi! Unfortunately no video on that yet, but maybe soon!
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?
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
@@BeABetterDev thanks! I ended up using python's setdefault() function for dictionaries to add default fields to the event dict.
Thanks. I ddnt realize the queryStringParamete stuff while I was building my API. Wasted several hours on this :(
How to make instagram api to get user details profilepic, full_name,etc
I followed exact steps although I'm getting "Internal Server Error" when accessing my API :(
Hi, can you check your cloudwatch logs to see what the error is? There is probably an error in your lambda function itself.
@@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
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)
};
@@BeABetterDev Hello! Yes, I though that too and already tried it although the issue remains
Did you find the problem?
"errorMessage": "'rawPath'",
"errorType": "KeyError",
is the error message
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)
I ran the code through a various ptyhon syntax checkers, and theres no issue with the syntax. What am I missing here?
Found the issue... there was a syntax error in the body of my POST in postman. :D
Glad you figured it out!