By using AWS re:Post, you agree to the Terms of Use

Handler error when connecting lambda function to RDS database


I am trying to follow the tutorial in to connect a lambda function to my database. I did not create a database from the tutorial, as I am trying to connect to an existing database. Whenever I run the code

aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt

I get the following error:

{"errorMessage": "Handler 'handler' missing on module 'app'", "errorType": "Runtime.HandlerNotFound", "stackTrace": []}.

I don't have any error with creating the lambda function. Does anyone know how I can fix this?

2 Answers

Try renaming handler(event, context) with lambda_handler(event, context) in

answered 6 months ago

you need to upload pymysql to your lambda fucntion as layer. Than you need to update your lamda script ....lambda_handler (event, context)

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions