I have a lambda function that retrieves records from AWS Aurora Serverless db. Now I thought of adding api gateway to trigger the lambda function but I get this error Connect an AWS Lambda function triggered by API Gateway to Aurora Serverless MySQL database.
[ERROR] BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation:
Access denied for user 'admin'@'10.x.xx.xxx' (using password: YES); Error code: 1045; SQLState: 28000
Traceback (most recent call last):
File "/var/task/index.py", line 11, in handler
sql="SELECT * FROM ecomdev.Customer;"
What is causing BadRequestException when calling the ExecuteStatement operation on Aurora Serverless db. I have used AWS CDK to create the stacks. I went through this question But it follows a different which I feel is not necessary. Please help me out if you have encountered this error.