Getting ready

We should understand the following concepts involved in AWS Lambda before we jump into writing a task for our lambda function.

  • Packaging our code for Lambda: AWS Lambda accepts .zip format packages, which includes code and libraries associated with code. We will be using Python 2.7 as our programming language to print a simple Hello World.
  • Role for Lambda: If our lambda function needs to access any other AWS resource, such as S3, RDS, and so on, then roles come in handy. We will be using an existing IAM role here called first_iam_role and discuss it in more detail in the upcoming recipe Managing IAM users.
  • Handler: This is the entry point for the execution of the lambda function. It's a way to tell Lambda which function is our main one. For example, if we create a file called hello_world.py and define a function called my_handler, then our handler will look like hello_world.my_handler.
  • Runtime: This is the environment for our lambda function. AWS Lambda supports multiple platforms, as we discussed earlier. In our case, this will be Python 2.7.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset