chenzhongpu
chenzhongpu

Reputation: 6871

AWS database connection refused

I created a postgresql instance on aws, and I made it publicly accessible. Also, I set both the inbound and outbound 0.0.0.0/0 in security group.

However, I cannot connect to this remote instance with my local computer. I also tried:

telnet <end point> 5432

It raised error:

telnet: connect to address xxx: Connection refused telnet: Unable to connect to remote host

What is the possible reason?

Update:

enter image description here

In the VPC:

enter image description here

In the subnets:

enter image description here

In the `route tables':

enter image description here

and its routes:

enter image description here

the internet gateway:

enter image description here Finally, the security group:

enter image description here

Upvotes: 1

Views: 4949

Answers (1)

srikanth Nutigattu
srikanth Nutigattu

Reputation: 1107

It is not just sufficient to select the "Publicly accessible" option and security group of RDS/DB. In addition, like any other instance it needs the ability (connected to Internet Gateway) and route to it.

The following document provides clear instructions for your DB/RDS to be accessible over the internet.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html#USER_VPC.Scenario4

Upvotes: 1

Related Questions