Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Amazon AWS API Gateway to Amazon RDS?

I have an Amazon AWS RDS (PostgreSQL) database. I am trying to connect it to Amazon API Gateway as simply as possible (AWS Service WITHOUT Lambda).

I am trying to perform a simple get request. To get all "animals" (table name "animals") from the db.

The question is which Action to select. All actions in the documentation change the db. And I need only to perform a simple GET request.

Also we need to setup the policy and specify the actions for it.

Api Gateway request:

https://i.ibb.co/2hkdVqZ/AWS.png

Api Gateway Policy:

https://i.ibb.co/vk8pLzd/AWS2.png

like image 738
Francesco Dal Savio Avatar asked Sep 10 '25 09:09

Francesco Dal Savio


1 Answers

The AWS API is for creating/changing the DB server itself, as you have mentioned. You can't query the RDS database directly from the AWS API. You have to create a DB connection to the PostgreSQL database using traditional database drivers in order to run queries against the database.

You will need to use a Lambda function to accomplish what you are trying to achieve.

like image 156
Mark B Avatar answered Sep 13 '25 06:09

Mark B