No video

Your first AWS Lambda function ever | Very simple example

  Рет қаралды 116,236

Data Science Garage

Data Science Garage

Күн бұрын

Пікірлер: 43
@DataScienceGarage
@DataScienceGarage 3 жыл бұрын
I hope you enjoyed this video! Subscribe the channel to get more fresh content, suggest your topic and have fun!
@liezelcuya5492
@liezelcuya5492 2 жыл бұрын
very helpful for me since I have 0 knowledge in creating Lambda. This is a good starting point!
@soumyajitsarkar2372
@soumyajitsarkar2372 3 жыл бұрын
This is really nice ! AWS confuses me, and I have avoided it till date, and given how complex it has become, it's really hard to get in now, especially if you are a beginner.
@DataScienceGarage
@DataScienceGarage 3 жыл бұрын
Thank you for such feedback! Appreciate, inspiring! :)
@Hasansaid51
@Hasansaid51 Жыл бұрын
Now I understand how to use it. But now why do I need to use it? What is the purpose of having a lambda function is where I am confused at. Also how to recognize when to use it?
@iammrchetan
@iammrchetan 2 жыл бұрын
I had seen other AWS lambda videos but those freaked me out. All want to make you perfect in the single video only regardless of their understanding level. I find your video very basic to start with it, that helped me really. Now I can go learning for another level. Thanks!
@patrickanthonylazocolque701
@patrickanthonylazocolque701 2 жыл бұрын
Really nice I was interesting in create a lambda function years ago.
@dsharma1978
@dsharma1978 2 жыл бұрын
Awesome tutorial! The lamda tutorial by AWS sucks, it only scared me further from AWS. This gave a good headstart.
@DataScienceGarage
@DataScienceGarage 2 жыл бұрын
Thanka fot feedback, glad it was beneficial! :)
@AIwithSohini
@AIwithSohini Жыл бұрын
Very helpful content. Thanks
@DataScienceGarage
@DataScienceGarage Жыл бұрын
Thanks for watching! :)
@jittendrakumar3908
@jittendrakumar3908 9 ай бұрын
This is pin point explanation
@TennisAryan
@TennisAryan 2 жыл бұрын
Where can we see the other outpus like the print statement used in the code while testing the code.
@robertocorti4859
@robertocorti4859 Жыл бұрын
I have a question. Let's say that I built and mantained in CodeCommit a repository that contains a library that is useful for serveral lambdas that I want to build. Is there a way to create Lambda functions that could include this repo? Thank you
@vincent_hall
@vincent_hall 2 жыл бұрын
Brilliant! Thank you. That's pretty simple, I was close when I tried it.
@codaq4043
@codaq4043 Жыл бұрын
I’m getting key error when trying to access my event but I’ve made sure I am referring to the correct key in the request test
@smittrivedi7924
@smittrivedi7924 Жыл бұрын
Simple and Good explanation, Thanks
@dalandan8300
@dalandan8300 2 жыл бұрын
crazy if conditions
@juanete69
@juanete69 Жыл бұрын
What if the output is not just text but an image or something interactive? How do you use this function externally?
@juanete69
@juanete69 Жыл бұрын
What is the object type and content of 'event'? And 'context'?
@takibahmed8859
@takibahmed8859 2 жыл бұрын
This was really helpful
@DataScienceGarage
@DataScienceGarage 2 жыл бұрын
Glad it helped! Thanks for watching! :)
@ravindran9210
@ravindran9210 2 жыл бұрын
Really nice video
@DineshKumar-bk5vv
@DineshKumar-bk5vv Жыл бұрын
Could you please make a video to integrate application using Amazon SQS Lambda function
@DataScienceGarage
@DataScienceGarage Жыл бұрын
It's a good idea. I will think about that, and will do.
@im4320
@im4320 2 жыл бұрын
I still dont understand actual use of lamba... if you are doing such if else or condition based things, that can be handled in code right? then what is actual use of this
@iammrchetan
@iammrchetan 2 жыл бұрын
As per the use cases you've: 1. Suppose the images from your websites are getting uploaded to the S3 bucket, then you need to process the images to resize, prepare thumbnails, convert in different format and store those in different S3 bucket. Off course, you can setup a EC2 setup and do that but what if you don't need to worry about the setup, scaling or maintenance? You just can use the AWS lambda which will do that for you, just pay as you use. 2. Another use case could be, you need to create backup of logs which are getting generated in your S3 bucket; so you just need to write the function to do the same and AWS will keep on running for you regardless of amount of data or traffic etc.
@geoffwtn
@geoffwtn 2 жыл бұрын
Very precise 👍
@DataScienceGarage
@DataScienceGarage 2 жыл бұрын
Thanks for watching! :)
@RanjithRanjith-se5dp
@RanjithRanjith-se5dp Жыл бұрын
Codes plz? Scripts of 'planet'
@Nirjeeva
@Nirjeeva Жыл бұрын
Can you please make videos on solution architect serverless foundation
@Nirjeeva
@Nirjeeva Жыл бұрын
# Runtime: Python 3.8 # Please review the comments for each code block to help you understand the execution of this Lambda function. # At the time you create a Lambda function, you specify a handler, # which is a function in your code, that AWS Lambda can invoke when the service executes your code. # The Lambda handler is the first function that executes in your code. # Python programming model - docs.aws.amazon.com/lambda/latest/dg/python-programming-model.html def lambda_handler(event, context): # context - AWS Lambda uses this parameter to provide runtime information to your handler. # event - AWS Lambda uses this parameter to pass in event data to the handler. This parameter is usually of the Python dict type. # AWS Lambda function Python handler - docs.aws.amazon.com/lambda/latest/dg/python-handler.html # When you invoke your Lambda function you can determine the content and structure of the event. # When an AWS service invokes your function, the event structure varies by service. # # In this lab, the lambda_handler "event" parameter has the following structure of name/value pairs: # { # "emoji_type": number, # "message": "string" # } # In a name-value pair you can extract the "value" of the pair using the "name" of the pair. # Here the id value is extracted from the event Lambda parameter and passed to a variable called emoji_type. emoji_type = event["emoji_type"] # Here the message value is extracted from the event Lambda parameter and passed to a variable called message. message = event["message"] # The variables are printed here, which means the variable values will be displayed in CloudWatch logs and the Execution Results panel. print(emoji_type) print(message) # In Python, you can create a variable with no value using the Built-in constant None. This means the variable "custom_message" currently has no value. custom_message = None # In Python, we use the if-elif-else to create a conditional execution. docs.python.org/3/reference/compound_stmts.html#the-if-statement # That is, if the value of emoji_type is equal to 0, we execute the statement inside its block if emoji_type == 0: # Only execute if id is equal to 1 # The variable custom_message combines "Message for code 0:" string with the variable message custom_message = "Message for code 0: " + message elif emoji_type == 1: # The variable custom_message combines "Message for code 1:" string with the variable message custom_message = "Message for code 1: " + message else: # The variable custom_message combines "Message for all other codes:" string with the variable message custom_message = "Message for all other codes: " + message # Optionally, the handler can return a value. What happens to the returned value depends on the invocation type you use when invoking the Lambda function # In this lab we use synchronous execution, so we need to create a response for the lambda function. # We created a "response" variable that has a structure of name-value pairs using the id and custom_message created earlier. response = { # In this name-value pair, the literal value "message" will store the value of the variable custom_message. "message": message, # In this name-value pair, the literal value "id" will store the value of the variable id. "custom_message": custom_message, } # Finally, we return the values from response variable to the caller, which could be a test event or an AWS service performing a synchronous call. # The execution of the lambda function is finished. return response Solution Need: 1). Modify the AWS Lambda function code to display different feeling values based on the emoji_type value in the JSON element. 2). update the lambda function using the following rule: emoji_type = 0, returns feeling: "positive emoji_type = 1, returns feeling: "neutral" emoji_type = any other value than 0 and 1, returns feeling: "negative" 3). after above updates, your Lambda function must return the interpreted sentiment in the following JSON format: { "feeling":"positive" "message":"I love the park" } 4). the validation code will look for a similar output as displayed above. any extra chracters in the output will fail the validation. Hints: Based on the sample code provided 1). Update the if-else block to add a feeling attribute (positive,neutral,negative) 2). change the response code to ass the feeling attribute instead of custom_message
@bitsbard
@bitsbard 10 ай бұрын
You've truly excelled with this! If you're hooked, a similar book should be in your reading list. "AWS Unleashed: Mastering Amazon Web Services for Software Engineers" by Harrison Quill
@DataScienceGarage
@DataScienceGarage 10 ай бұрын
Thanks for sharing that! I will check this :) thanks for watching!
@TechMalaya
@TechMalaya 2 жыл бұрын
nice tq!
@DataScienceGarage
@DataScienceGarage 2 жыл бұрын
Thanks for watching! :)
@rehantayyab82
@rehantayyab82 2 жыл бұрын
a person who dont have development background and going to start his career in aws solution architect which programming language he should concentrate in aws industry java , python , power shell etc ........ plz advice
@im4320
@im4320 2 жыл бұрын
go with python/java/terraform/Cloud formation
@gawronwwa
@gawronwwa 2 жыл бұрын
C#
@suresh2105
@suresh2105 Жыл бұрын
@DataScienceGarage
@DataScienceGarage Жыл бұрын
Thanks for watching! :)
@SylviaFerguson-u8g
@SylviaFerguson-u8g 14 күн бұрын
Rodriguez Carol Harris Edward Brown Kimberly
AWS Step Functions to orchestrate Lambda functions - Step by Step Example
15:39
English or Spanish 🤣
00:16
GL Show
Рет қаралды 15 МЛН
Nurse's Mission: Bringing Joy to Young Lives #shorts
00:17
Fabiosa Stories
Рет қаралды 14 МЛН
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 25 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 14 МЛН
Create Your First AWS Lambda Function | AWS Tutorial for Beginners
12:44
Tiny Technical Tutorials
Рет қаралды 141 М.
Using Python to Automate AWS Services | Lambda and EC2
24:10
Travis Media
Рет қаралды 28 М.
AWS Lambda Introduction - What is it and Why is it Useful?
13:34
Be A Better Dev
Рет қаралды 134 М.
How do I deploy AWS Lambda using Terraform?
18:52
Rahul Wagh
Рет қаралды 44 М.
Top 5 Use Cases For AWS Lambda
12:36
Be A Better Dev
Рет қаралды 81 М.
The Most Important AWS Core Services That You NEED To Know About!
18:09
Be A Better Dev
Рет қаралды 412 М.
Intro to AWS Lambda with Python | AWS Lambda Python Tutorial
32:01
Block Explorer
Рет қаралды 260 М.
English or Spanish 🤣
00:16
GL Show
Рет қаралды 15 МЛН