Francesco Dal Savio
Francesco Dal Savio

Reputation: 53

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

Upvotes: 4

Views: 1595

Answers (1)

Mark B
Mark B

Reputation: 200657

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.

Upvotes: 4

Related Questions