Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon API Gateway to lambda to rds?

I am trying to have a mobile app access an amazon rds postgres instance. Referencing https://stackoverflow.com/questions/36103629/is-it-posible-to-query-an-amazon-rds-instance-directly-from-api-gateway#=, Mark said "You should look into pointing API Gateway at a Lambda function that has the ability to connect to your RDS database and run queries." So my question is could I implement this approach using this link: http://docs.aws.amazon.com/lambda/latest/dg/vpc-rds.html and then using api gateway to point at that lambda function? Then any mobile client with credentials from cognito would be able to call that api? Am I correct and is this the best way? My worries is that since a VPC is involved, only a small number of people will be able to use the lambda function.

like image 807
Jason Chitla Avatar asked Oct 18 '22 07:10

Jason Chitla


1 Answers

Yes you could use the technique listed in your link (which is exactly what I was referring to in my other answer that you reference) and then expose that Lambda function via API Gateway. This is (one of ) the correct ways to accompolish this.

My worries is that since a VPC is involved, only a small number of people will be able to use the lambda function.

I don't understand what you are saying here. Why would use of a VPC restrict the number of people that could use the Lambda function?

like image 187
Mark B Avatar answered Oct 21 '22 05:10

Mark B