AWS RDS: cannot connect to server

0

I have created a RDS PostgreSQL DB Instance, see it in AWS Explorer. But cannot connect to it using pgAdmin, it responses: Unable connect to server etc. How to fix it?

ps. It is Publicly accessible, also , I have added inbound rule: all trafic, all ports, My Ip - but again cannot connect from pgAdmin

port range: all type: all trafic source type: custom protocol: all source: myip/32

  • Please provide more information to how your trying to connect to the Rds instance and what your network connectivity looks like

  • Please see above I have edited my question. Also, I use pgAdmin on my computer, it shows me an INTERNAL SERVER ERROR: unable to connect etc

Oleg
asked a year ago614 views
2 Answers
0

The fact that you’re trying a 172.x address raises the question is your RDS really publicly accessing?

A 172.16.0.0/12 network range is an RFC1918 address space. I’m going to assume the IP address returned via a dns lookup is a 172.31.x.x which is the default VPC CiDR range. You will never be able to connect to this address over the public internet.

Connecting via dns name or its ip will always result in the same issue.

A few things you need to check.

  1. The Rds instance is in a public subnet.
  2. the RDS instance does have Public accessible set
  3. The public subnet default routes to an IgW
  4. The security group on the RDS allows your PUBLIC ip and not the private IP of your home machine.
  5. NACLs allow connectivity to and from the postgress port and ip address
profile picture
EXPERT
answered a year ago
  • Thank you. Could you please look at my rules, what is wrong there: GroupId,GroupName,Type,IpProtocol,FromPort,ToPort,IpRanges,Ipv6Ranges,PrefixListIds,UserIdGroupPairs sg-06517,default,Inbound/Ingress,'-1,,,0.0.0.0/0,,, sg-06517,default,Inbound/Ingress,'-1,,,,::/0,, sg-06517,default,Inbound/Ingress,'-1,,,,,,sg-06517 sg-065*17,default,Outbound/Egress,'-1,,,0.0.0.0/0,,,

  • Rules look fine. Does the dns name return a 172.31 ip address?

  • nslookup 12121212.eu-west-2.rds.amazonaws.com DNS request timed out. timeout was 2 seconds. Server: UnKnown Address: fe80::b669:.... DNS request timed out. timeout was 2 seconds. DNS request timed out. timeout was 2 seconds. *** Request to UnKnown timed-out

  • Looks like now you have dns resolution issues with dns timeouts.

0

Hi, it's probably a routing issue: If you connect via the dns name, try to run nslookup (windows) to get the ip address and then try to connect via this ip instead of dns.

Another way to check the root of your problem it to telnet to the dns name / ip + port to see if you get the tcp session properly established. For that, see https://netbeez.net/blog/telnet-to-test-connectivity-to-tcp/

profile pictureAWS
EXPERT
answered a year ago
  • Telnet: Connecting To ***.eu-west-2.rds.amazonaws.com...Could not open connection to the host, on port 5432: Connect failed

  • Also, Microsoft Telnet> open 172...** 5432 Connecting To 172...** ...Could not open connection to the host, on port 5432: Connect failed

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions