Utkarsh Vishnoi
Utkarsh Vishnoi

Reputation: 1

Getting Handler Error in Response of AWS Lambda function Test

Created a lambda function to retrieve value from dynamodb.When I am testing the function I am getting an error in response?

enter image description here

enter image description here

Couldn't find any answer on the internet.

Upvotes: 0

Views: 169

Answers (2)

Cloud Wanderer
Cloud Wanderer

Reputation: 187

Seems like in line 6 you have used

def handler(event,context):

instead of

def lambda_handler(event,context):

If you want to keep using def handler(event,context): you also need to enter this in 'Handler' option in 'Runtime Settings'

enter image description here

Upvotes: 0

Leeroy Hannigan
Leeroy Hannigan

Reputation: 19793

Your function should be named lambda_handler

def lambda_handler(event,context):

The documentation provides more information on this here: https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html

Upvotes: 1

Related Questions