3
votes

have created a postgre instance in RDS and have created a security group for the VPC with below inbound rules:

Type             Protocol      PortRange      Source
Custom TCP Rule   TCP          5432          0.0.0.0/0
All traffic       All          All           0.0.0.0/0

I try to connect to the RDS instance using pgAdmin , but get the below error

could not connect to server: Operation timed out Is the server running on host "xxxxx-1.rds.amazonaws.com" (54.xxx.xxx.83) and accepting TCP/IP connections on port 5432?

Can you tell me what am i missing?

2
This is off topic for Stack Overflow. You're better off on ServerFault. That said - at a guess, your VPC configuration isn't forwarding the port. You're only showing us a small slice of your configuration (which with VPC can be quite complex) so it's very hard to say.Craig Ringer

2 Answers

0
votes

Given that you have specified that you have launched the Postgre RDS instance inside a VPC, you have to make the subnet a Public Subnet by attaching the subnet to an Internet gateway in which the Postgre RDS instance is launched.

Check here for more information about adding an internet to your VPC

0
votes

First, if RDS(Postgresql) is located in private subnet, pgAdmin cannot connect to RDS even if the private subnet is connected to NAT Gateway which is in public subnet. So to make the private subnet public, set Internet Gateway to the private subnet instead of NAT Gateway.

Second, check Public access of RDS setting is Yes showing below. If it's No, tools outside your VPC cannot connect to RDS.

enter image description here

Your Security Group is fine, no problem.