Complete the code to define the AWS Lambda handler function name.
def [1](event, context): return 'Hello from Lambda!'
The AWS Lambda function handler must be named as specified in the configuration, commonly lambda_handler.
Complete the code to accept the event parameter in the Lambda handler function.
def lambda_handler([1], context): print(event) return 'Done'
The first parameter of the Lambda handler function is event, which contains the input data.
Fix the error in the Lambda handler function definition by completing the missing parameter.
def lambda_handler(event, [1]): print('Context:', context) return 'Success'
The second parameter must be named context to access runtime information.
Fill both blanks to correctly return a JSON response with status code and body.
def lambda_handler(event, context): response = { 'statusCode': [1], 'body': [2] } return response
The status code 200 means success, and the body must be a JSON string.
Fill all three blanks to parse a key from the event and return it in the response body.
def lambda_handler(event, context): key_value = event.get([1], None) response = { 'statusCode': [2], 'body': f"Value is: { [3] }" } return response
We get the value for 'key' from the event, return status 200, and include the value in the body.