Lambda returning value
In Lambda, you can return a value that is either a simple message or a complex event with JSON. In the following example, you can see a sample returning message for Lambda:
def handler_name(event, context):
message = 'Weather details. Temperature: {} and Wind: {}!'.format(event['Temperature'], event['Wind'])
return message
In this example, Lambda takes Temperature and Wind as input and returns these parameters as a message. In the following example, you can see a more complex return value:
def handler_name(event, context):
return {
"statusCode": 200,
"Temperature": 10,
"Wind": -5
}
As you can see in this example, the return value consists of a simple object to be parsed by the invoker. For example, if Lambda...