Accessing your MySQL / RDS through Lambda function.


I’m currently trying to write my own Lambda to retrieve data from my RDS instance / MySQL table. Using the Lambda set up generated by the CloudCanvas / Resource Manager, how do you achieve this? I noticed it is difficult to work around the generated lambda structure in order to import external modules for mysql queries.

Hi @naotoy!

We talked this over this afternoon and have a plan for how to add this feature the correct way, unfortunately until we can add it there will be some manual work necessary, as our security model purposefully prevents the ability to assign access to endpoints of a user’s choosing through the resource template. It should be possible to hard code the arn of your table endpoint into your lambda somewhere, and after that lambda is deployed by cloud canvas you can modify the permissions to give it the desired access to your table in the AWS console.

Yes, I actually did use the resource manager to instantiate the RDS instance (by writing my own CloudFormation for a simple RDS), but regardless I would just like to connect to the DB/RDS endpoint and run MySQL queries.

Thanks for the quick response!

Hey @naotoy,

So from what I understand you already have the RDS instance set-up (not using the Resource manager) and you want to create a lambda that has permissions to access that RDS instance and make queries correct?


Thanks to the follow up ! Looking forward to your team’s implementation of this! For now, I got it working to a certain extent…