0

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.

2
  • Name your function lambda_handler instead of handler. Commented Dec 26, 2022 at 16:22
  • 1
    Please be mindful not to share images of code or exceptions as it's against the community guidelines Commented Dec 26, 2022 at 16:49

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.