5
votes

I am trying to have a mobile app access an amazon rds postgres instance. Referencing https://stackguides.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.

1

1 Answers

3
votes

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?