Handler error when connecting lambda function to RDS database

0

I am trying to follow the tutorial in https://docs.aws.amazon.com/lambda/latest/dg/services-rds-tutorial.html 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 回答
1

Try renaming handler(event, context) with lambda_handler(event, context) in app.py

已回答 2 年前
0

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

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则