A Lambda skeleton
When you implement a Lambda function via Python, you need to follow some rules in order to execute the application. When a Lambda function is run, it calls the handler method, which is shown with the following syntax:
def lambda_handler(event, context): ... return some_value
As you see, the first parameter is the event object. An event object consists of JSON in order to process data as a parameter. You can see a sample parameter here:
{
"Temperature": 10,
"Wind": -5
}
The second parameter shows information about the Lambda runtime. You can see some of the runtime fields here:
function_name(the name of the function)function_version(the version of the function)memory_limit_in_mb(the Lambda function memory limit)
We've looked at the main skeleton of the Python Lambda function. In the next section, we'll see how to return a value...