Score:1

What is causing BadRequestException when calling the ExecuteStatement operation on Aurora Serverless db

cn flag

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.

Score:0
cn flag

Error 1045 apparently means 'Access denied'. Have you set the credentials properly in your Lambda? Does the lambda use the right execution role? Seems to be some more good info here.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.