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
As an AWS engineer I have to say, very good tutorial video. Why such a channel only has 21k sub??? For begineers, your videos are better than our official ones.
get this ...{"transactionId": "5", "transactionType": "'PURCHASE'", "transactionAmount": "500", "message": "xyz says HELLO"} .... finally understand what api gateway/lambda is doing....great job AWS Simplified!
Great tutorial! this is just memo for other beginners. ●can't test in lambda console? try something like this ↓ { "queryStringParameters":{ "transactionId": "5", "type": "purchase", "amount": "100" } } ●internal server error? you need equal in line 25 ↓ responseObject['headers'] = {} and check typos . Thanks!
Excellent Tutorial. I'm currently learning how to use AWS Lambda and AWS API gateway to create a serverless USSD with Africa's Talking using python. Ideally I want to automate the entire process using Terraform.
Great tutorial. Explained better than even AWS official ones. One suggestion: Next time show how you debug the error also. I get that you use cloud trail here but it'll still be useful to newcomers
Thanks a lot🙏🙏 Before watching this, I watched a couple of videos on lambda function, but still I couldn't understand what the hell lambda function is, you made it very clear...
Man but like how good is this video?? You're insane! Thanks a lot! I was looking for something like this for a small learning project I have in mind with flutter and aws (just to learn aws because tbh its pretty daunting to me). Thanks a lot again!!
Excellent tutorial! Thank you very much! I am enjoying your channel a lot. I'm just starting out with AWS but I'm super curious about how things work and you're becoming my one stop shopping channel! Cheers!
Great tutorial. Helped me on how to handle event with python. I am using a Lambda function to perform Geocode and REST API for client to invoke the API
Great video, no only this but all the others in the channel too. I dont like the sounds with the mouth when starting new words, but anyway best AWS channel in youtube so far.
I am using the same code that yu gave .. but facing key error. Error: { "errorMessage": "'queryStringParameters'", "errorType": "KeyError", "stackTrace": [ [ "/var/task/lambda_function.py", 9, "lambda_handler", "transactionId = event['queryStringParameters']['transactionId']" ] ] } Input: transactionId=1&type=abc&amount=123
Getting the following error when I tested the lambda function (without using the API gateway endpoint): { "errorMessage": "'queryStringParameters'", "errorType": "KeyError", "stackTrace": [ [ "/var/task/lambda_function.py", 7, "lambda_handler", "transactionId = event['queryStringParameters']['transactionId']" ] ] Any insight on how to fix this? Not sure how everyone is able to use the same code... Seems like there is an issue with the code itself.
Hi there, have you tried to print out the event that has been passed into the lambda function to see if the input contains query string parameter's. It seems like your functions code is trying to access that field but it is not present in the event. One other possibility is that you created a post API instead of a GET API. This will result in the payload been inside the body of the request instead of query string parameter's. Hope this helps.
OMG, thank you sooooo much for this video!!! Building a simple website for my wedding in a few months and wanted to be able for folks to RSVP online and the data loaded to a dynamoDB server to keep everything organized. Spent literally all day yesterday going thru guides and documentation with no success. Would just be curious if you would need to do anything differently for a post method instead of get. Web design is not my forte, which is why I wanted this project to challenge myself. Thanks again!!!
Hi Kyle! Thanks for watching and congratulations on your wedding. I'm also getting married soon and hope you're able to have a happy day despite covid. In terms of your question, the only difference is that you would select the POST method during the api creation in API gateway. Also, the location of the parameters being passed into your lambda function will change (they will likely no longer be in the query param's field, but instead in the 'body'). The quickest way to find out where is just to console.log the input object (event) and find out where in the object the param's are being passed. Hope this helps and feel free to reach out if you have any followup Q's.
Thanks man. I am new to Cloud but somehow I managed to secure somewhat senior position as AWS DevOps Engineer and now facing the music. I came across a similar requirement, Thanks for the help Sir
@@klayliu3078 Hi, Is your response the same as his? my returns -->{ "errorMessage": "'queryStringParameters'", "errorType": "KeyError", "stackTrace": [ [ "/var/task/lambda_function.py", 7, "lambda_handler", "transactionId = event['queryStringParameters']['transactionId']" ] ] }
Can someone please explain how the output that was returned (in the browser) was formatted with a : following the transactionID, type, amount and message and a " " surrounding 5, PURCHASE, 500 and Hello from Lambda land ? I don't see any formatting in the code related to the formatting in the output.
Thanks Dan , if i want lambda to run query against mysql db , then retrieve results in json format or do crud on db using lambda and api ,, how is that possible ?
Hi Georgia! You can do this by combining the contents of this tutorial with these two other videos on how to set up a RDS MySQL DB + How to query it from Lambda. Hope this helps! ua-cam.com/video/Ng_zi11N4_c/v-deo.html and ua-cam.com/video/vyLvmPkQZkI/v-deo.html
Straight to the point. Thank you. I was wondering how we could add an authentication to the request as well. My request returns Missing Authentication Token. I don't want to make the API public as it is sending a separate request to a paid API.
I love this, this is very straight forward. But as a beginner in the field of AWS I just want a clarification. The method you used, why GET and not POST method?
If we are getting Json inputs from front end then how we can handle it using Lambda funtion+API gateway and I need to store that data in RDS instance in table form
I'm getting this message "Function not found: arn:aws:lambda:us-east-1:313987576106:function:TransactionProcessor" And "Internal server" when continued. What could be the reason? I've carefully gone through all the steps
Hi Gayathri, Are you sure that you have created a Lambda function called TransactionProcessor? Also, can you check to make sure it is indeed in us-east-1?
Hi Gayathri. Are you able to check the logs of your invocation to see where it is failing? They should be available by going to the monitoring section of your lambda.
while trying this the lambda functions works successfully but the deployment of API throws an error “User does not have LISTWEBACL and AssociateWEBACL persmision for Web application Firewall regional” please help
In our use case, we built an API Gateway to call a collection of microservices, from lambda(new code) & HTTP (legacy code). It works well, but I'd advise anyone working on a serverless architecture to look into how to keep lambdas "warm"
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
Sorry this Course is not available in udemy. :)
As an AWS engineer I have to say, very good tutorial video. Why such a channel only has 21k sub??? For begineers, your videos are better than our official ones.
Thanks for your support . The subscribe count jump to 53k+ ...👍
Now its 117K. Super fast.
now its 149k
254k 😮
@@ZacheryBlakeDavis subs, not views
get this ...{"transactionId": "5", "transactionType": "'PURCHASE'", "transactionAmount": "500", "message": "xyz says HELLO"} .... finally understand what api gateway/lambda is doing....great job AWS Simplified!
Great to hear I was able to help!
This is the best exemplification I have ever seen so far. I could not find any other resources better than this channel.
This dude is way more Good then actual AWS guys. And video is super sharp to the point (Y) Loved it
Thank you so much for your kind words!
Wow. Short, complete, accurate and useful. You are remarkably good at making instructional videos. Thank you.
Thanks for the kind words Faithin!
Great tutorial!
this is just memo for other beginners.
●can't test in lambda console?
try something like this ↓
{
"queryStringParameters":{
"transactionId": "5",
"type": "purchase",
"amount": "100"
}
}
●internal server error?
you need equal in line 25 ↓
responseObject['headers'] = {}
and check typos
.
Thanks!
Thank you for the catch!
No stories , to the point , Thank you ! Subscribed
Thanks dileep! And welcome to the channel :)
I love 10 mins tutorial and this one is perfect 10 min tutorial. Thanks.
Thanks so much kishor!
Great work! Appreciate you showing the event structure right at the beginning which is usually skipped by many.
Very simple explanation to the point .
It could use updating, as AWS has changed its API Gateway UI substantially. GREAT WORK, THANKS!
Thanks for pointing this out Kent! Time for a new video :)
Go for it! If you need any help, I volunteer!
Excellent Tutorial. I'm currently learning how to use AWS Lambda and AWS API gateway to create a serverless USSD with Africa's Talking using python. Ideally I want to automate the entire process using Terraform.
It was great to see and understand the basic flow with API Gateway + Lambda, thanks.
Glad it was helpful!
Superb intro to using the API gateway, good tutoring skills!
Thanks phillip!
Thanks a ton for your tutorial here. I just needed a quick rundown and this is exactly what I needed. Quick and concise.
Glad it helped!
thanks man for this amazing video
it helped me in completing my internship task
keep up the good work
Great video! Thanks for demonstrating API Gateway + Lambda integration
Glad you enjoyed Wes.
Great tutorial. Explained better than even AWS official ones.
One suggestion: Next time show how you debug the error also. I get that you use cloud trail here but it'll still be useful to newcomers
Thank you Harsha for the kind words and the feedback!
@@BeABetterDev What was the fix to that error anyway?
Very efficient, straight to the point, extremely helpful. Thank you.
Thanks a lot🙏🙏
Before watching this, I watched a couple of videos on lambda function, but still I couldn't understand what the hell lambda function is, you made it very clear...
Man but like how good is this video?? You're insane! Thanks a lot! I was looking for something like this for a small learning project I have in mind with flutter and aws (just to learn aws because tbh its pretty daunting to me). Thanks a lot again!!
Thank you so much for such a kind comment, I really appreciate it!
As others already mentioned --- what's the fix for the line 25 syntax error that you said you'd get back to?
Excellent tutorial! Thank you very much! I am enjoying your channel a lot. I'm just starting out with AWS but I'm super curious about how things work and you're becoming my one stop shopping channel! Cheers!
Love this video. If only they gave examples like that in the official documentation, instead of just dry theory
Thanks for the kind words heikg. I'm glad you found it helpful :)
Great tutorial. Helped me on how to handle event with python. I am using a Lambda function to perform Geocode and REST API for client to invoke the API
Glad it helped Jiyong!
Good one. To the point. Simple. Best way to dive in.
Thanks Prasad!
Great video, no only this but all the others in the channel too. I dont like the sounds with the mouth when starting new words, but anyway best AWS channel in youtube so far.
Thanks for the feedback!
Awesome video..!! I am planning to create ETL data pipes using lambda + API gateway and then use step functions or MWAA to orchestrate the Lambda.
When I go to url, it only shows me the message which is "Hello from Lambda!" instead of showing all the json. Does anyone know how to fix this?
I am using the same code that yu gave .. but facing key error.
Error:
{
"errorMessage": "'queryStringParameters'",
"errorType": "KeyError",
"stackTrace": [
[
"/var/task/lambda_function.py",
9,
"lambda_handler",
"transactionId = event['queryStringParameters']['transactionId']"
]
]
}
Input: transactionId=1&type=abc&amount=123
What a fantastic tutorial! Great job!
Thank you! Cheers!
Getting the following error when I tested the lambda function (without using the API gateway endpoint):
{
"errorMessage": "'queryStringParameters'",
"errorType": "KeyError",
"stackTrace": [
[
"/var/task/lambda_function.py",
7,
"lambda_handler",
"transactionId = event['queryStringParameters']['transactionId']"
]
]
Any insight on how to fix this? Not sure how everyone is able to use the same code... Seems like there is an issue with the code itself.
Hi there, have you tried to print out the event that has been passed into the lambda function to see if the input contains query string parameter's. It seems like your functions code is trying to access that field but it is not present in the event. One other possibility is that you created a post API instead of a GET API. This will result in the payload been inside the body of the request instead of query string parameter's. Hope this helps.
Short and Simple. Best tutorials. Keep Teaching :). Thank you
You are very welcome!
OMG, thank you sooooo much for this video!!! Building a simple website for my wedding in a few months and wanted to be able for folks to RSVP online and the data loaded to a dynamoDB server to keep everything organized. Spent literally all day yesterday going thru guides and documentation with no success. Would just be curious if you would need to do anything differently for a post method instead of get. Web design is not my forte, which is why I wanted this project to challenge myself. Thanks again!!!
Hi Kyle! Thanks for watching and congratulations on your wedding. I'm also getting married soon and hope you're able to have a happy day despite covid.
In terms of your question, the only difference is that you would select the POST method during the api creation in API gateway. Also, the location of the parameters being passed into your lambda function will change (they will likely no longer be in the query param's field, but instead in the 'body'). The quickest way to find out where is just to console.log the input object (event) and find out where in the object the param's are being passed.
Hope this helps and feel free to reach out if you have any followup Q's.
Amazingly great and simple to get point. Salute
Thank you so much for your kind words!
Thank you bro for keeping it clean and simple. I love it.
Thanks Muse! Really appreciate the kind words.
Thanks man. I am new to Cloud but somehow I managed to secure somewhat senior position as AWS DevOps Engineer and now facing the music. I came across a similar requirement, Thanks for the help Sir
Simple and Effective, as always!!
Wow, everything I needed put together in one video!! Thanks alot bro!
You are very welcome didi!
to-the-point. Thx. Keep up the good work!
Thanks Lio!
thanks. simple enough to get started with API gateway and integration points
Thanks
Thank you so much for your generosity!
Good tutorial. Tested and it works
Thanks so much for this awesome tutorial! Really clear and well-paced.
You're very welcome!
Thanks for the tutorial. This helped me resolve an error I was getting.
Glad it helped!
That was a concise tutorial. Thank you
Nice. Just in time. I just got done with Fast API.
Best Tutorial. You made it so simple. Thank You
Woow it is very nice explanation with example .. it help me to understand API with Lambda..
Thanks
You are most welcome
Wow wow wow, made it very easy and understandable. thanks
You are welcome 😊
Great explanation and good demo
Gracias, me has salvado la vida compadre, desde Ecuador.
Thanks Andres!
Well Explained. Simply Awesome. :)
Thanks a lot 😊
Very well explainations. Good for a starting point. Thanks a lot.
Great explanation
Glad it was helpful!
Nice and fast. Thanks.
You're very welcome Raul!
Cool video but I get an internal server error saying it doesn't recognise 'queryStringParameters' I have no idea how to fix it after a few hours
Hi there, did you use a GET method ?
Great stuff!! Thanks a lot for the overview!!👍🏼
Thanks sanket!
Magnifique ! thanks for this tutorial
NIce tutorial on api and lamda function
Thanks Gordon!
Shouldn't line 20 in the code be responseObject['headers'] = {}?
To the point video. Appreciate it.
Glad it was helpful!
Great video! Looks like queryStringParameters doesnt work in AWS with the new Python 3.10. Any ideas how to correct this?
very well explained . Thanks for the video
05:42 In my case, "=" is required at line 25.
Thank you for pointing this out!
Thanks, your answer fixed my error.
[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'lambda_function': invalid syntax (lambda_function.py, line 25)
Traceback (most recent call last):
File "/var/task/lambda_function.py" Line 25
responseObject['headers']{}
--------------------------
line 25 should be:
responseObject['headers'] {} ==> responseObject['headers'] = {}
@@klayliu3078 Hi, Is your response the same as his? my returns -->{
"errorMessage": "'queryStringParameters'",
"errorType": "KeyError",
"stackTrace": [
[
"/var/task/lambda_function.py",
7,
"lambda_handler",
"transactionId = event['queryStringParameters']['transactionId']"
]
]
}
Thanks a lot, this was really helpful!!!!! Have a nice day :)
You're very welcome paul, and you too!
Let me try ,..happy to get this video
Thanks Sateesh. Were you able to create your API?
Excellent work
Thank you! Cheers!
Hi , I would like to ask how to assign static ip address to APIGW ?
Great video!
Really ur videos r so good
Thank you so much 😀
I think there is a typo in responseObject[‘headers’] {}
Fantastic video, many thanks!
Thank you so much! This was tremendously helpful!
You're so welcome!
Can someone please explain how the output that was returned (in the browser) was formatted with a : following the transactionID, type, amount and message and a " " surrounding 5, PURCHASE, 500 and Hello from Lambda land ? I don't see any formatting in the code related to the formatting in the output.
transactionID: "5"
type: "PURCHASE"
amount: "500"
message: "Hello from Lambda land"
Thank you in advance.
How would a client access this programmatically?
Thanks Dan , if i want lambda to run query against mysql db , then retrieve results in json format or do crud on db using lambda and api ,, how is that possible ?
Hi Georgia!
You can do this by combining the contents of this tutorial with these two other videos on how to set up a RDS MySQL DB + How to query it from Lambda.
Hope this helps!
ua-cam.com/video/Ng_zi11N4_c/v-deo.html and ua-cam.com/video/vyLvmPkQZkI/v-deo.html
thanks for sharing...it was really helpful.
You're very welcome
a cool little trick to use if you want to print a variable name and its value is to do (with transaction_id as example): print(f'{transaction_id=}')
Thanks for this cool tip Felix!
Great video super insightful thanks!
How can I check status of rds instance is running or not using python script
I am new to AWS and API, Is there a video where I can learn to make external API Calls using Lambda?
Thanks
Great job with the video
Thanks!
Getting the syntax error on responseObject['headers'] {} as mentioned on video, not sure how to fix this pls?
Hi there,
See comments section - many folks have corrected the issue!
Nice video
Thank you!
very helpful. just a query that i want to understand the code so can you provide me with any link which could help me understanding the code
There's a '=' missing in the code: responseObject['headers'] = {}
You're right.
Well presented. Would be good to see the API Gateway raise an event to Event bridge and then Event bridge match to the Lambda and return the same way.
Straight to the point. Thank you. I was wondering how we could add an authentication to the request as well. My request returns Missing Authentication Token. I don't want to make the API public as it is sending a separate request to a paid API.
I love this, this is very straight forward. But as a beginner in the field of AWS I just want a clarification. The method you used, why GET and not POST method?
If we are getting Json inputs from front end then how we can handle it using Lambda funtion+API gateway and I need to store that data in RDS instance in table form
Good question - stay tuned for an upcoming video on the topic!
I'm getting this message "Function not found: arn:aws:lambda:us-east-1:313987576106:function:TransactionProcessor"
And "Internal server" when continued. What could be the reason? I've carefully gone through all the steps
Hi Gayathri,
Are you sure that you have created a Lambda function called TransactionProcessor? Also, can you check to make sure it is indeed in us-east-1?
@@BeABetterDev Function creation successful.👍🏻 But still I'm getting internal server error while invoking the url
Hi Gayathri. Are you able to check the logs of your invocation to see where it is failing? They should be available by going to the monitoring section of your lambda.
@@BeABetterDev Thank you for the tutorial and quick response to queries. Thank you!
You're very welcome!
I am not getting response when I used invoke url with transaction details.
It Only display "hello from lambda"
Don't add the "transaction" resource and you should be good to go
@@betci148 Im getting the same response as Anish. Do you mean we don't create a child resource? Why cant we create a child resource like in the video?
@@xosauce9193 You need to deploy your lambda function. The 'hello from Lambda' is the original AWS and not your code
Splendid 👌more videos please
Coming soon!
What was the syntax error on line 25?
['header'] = {}
Great video. One small point. You mentioned about a syntax error in line 25, but doesn’t address that later in the video.
What was the actual fix to that error anyway?
@@timothyle4820 he missed out an equals character before the empty dictionary. I think he simply fixed it off screen.
@@timothyle4820 Just add the = symbol before the {}
while trying this the lambda functions works successfully but the deployment of API throws an error “User does not have LISTWEBACL and AssociateWEBACL persmision for Web application Firewall regional” please help
Hi team I have a use case where we need to get name and ID from through api
In our use case, we built an API Gateway to call a collection of microservices, from lambda(new code) & HTTP (legacy code). It works well, but I'd advise anyone working on a serverless architecture to look into how to keep lambdas "warm"
Good advice Derek, Provisioned Concurrency is a life saver!