skip to Main Content

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

Answers


  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

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search