Your first AWS Lambda function ever | Very simple example

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

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

  • @DataScienceGarage
    @DataScienceGarage  3 года назад +11

    I hope you enjoyed this video! Subscribe the channel to get more fresh content, suggest your topic and have fun!

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

    very helpful for me since I have 0 knowledge in creating Lambda. This is a good starting point!

  • @soumyajitsarkar2372
    @soumyajitsarkar2372 3 года назад +12

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

      Thank you for such feedback! Appreciate, inspiring! :)

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

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

    Awesome tutorial! The lamda tutorial by AWS sucks, it only scared me further from AWS. This gave a good headstart.

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

    Really nice I was interesting in create a lambda function years ago.

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

    Very helpful content. Thanks

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

    Brilliant!
    Thank you.
    That's pretty simple, I was close when I tried it.

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

    Simple and Good explanation, Thanks

  • @jittendrakumar3908
    @jittendrakumar3908 9 месяцев назад

    This is pin point explanation

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

    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?

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

    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

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

    Where can we see the other outpus like the print statement used in the code while testing the code.

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

    Really nice video

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

    crazy if conditions

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

    This was really helpful

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

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

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

      Thanks for sharing that! I will check this :) thanks for watching!

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

    Very precise 👍

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

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

    nice tq!

  • @DineshKumar-bk5vv
    @DineshKumar-bk5vv Год назад

    Could you please make a video to integrate application using Amazon SQS Lambda function

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

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

      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.

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

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

      go with python/java/terraform/Cloud formation

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

      C#

  • @RanjithRanjith-se5dp
    @RanjithRanjith-se5dp Год назад

    Codes plz? Scripts of 'planet'

  • @SylviaFerguson-u8g
    @SylviaFerguson-u8g 27 дней назад

    Rodriguez Carol Harris Edward Brown Kimberly