Handler error when connecting lambda function to RDS database
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?
Try renaming handler(event, context) with lambda_handler(event, context) in app.py
you need to upload pymysql to your lambda fucntion as layer. Than you need to update your lamda script ....lambda_handler (event, context)
Relevant questions
Handler error when connecting lambda function to RDS database
asked 2 months agoAWS Lambda not able to connect to public RDS instance
asked a month agoCan't connect to an RDS Instance from Lambda (different account tough)
asked 2 years agoWhy can't I find my RDS database from my lambda function?
asked 2 months agoTimeout error accesing MySql RDS from a Lambda function
asked 5 years agoAccess Denied error when using Lambda IAM role to access Amazon RDS for MySQL
Accepted Answerasked 2 years agoUsing DocumentDB with Lambda: connection pooling
Accepted Answerasked a year agoInternal Server Error from API Gateway when sending queries through gateway to Lambda function connected to RDS database
asked 2 months agoHandler error python lambda function
asked 2 months agoRDS SSL error
asked 2 years ago