2

I have created an AWS RDS postgres instance and i am trying to hit the db using postgres4 dashboard from my local machine but am unable to create a connection and it is throwing an error like

Unable to connect to server:
could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "clienteledev2.XXX.ap-south-1.XXX.com" (xx.xx.xx.xx) and accepting
TCP/IP connections on port 5432?

I went through AWS documentation and have already done the necessary settings like: setting public availability

1)setting Public accessibility flag to YES

2)Adding inbound rule in security group in order to open ports for communication i.e port 5432 as tcp for postgresSQL

3)even have added rule for incoming traffic from my machine as custom tcp and for source myIP

(see the screenshot) security group inbound rules

I am using default VPC which is public and on my personal machine i have exempted or allowed pgadmin to connect through firewall.

I have searched enough online and have found some solutions suggested for previous questions like these none of them worked. What is that i am doing wrong?

4
  • You have to explicitly allow your local machine's IP address in the security group inbound rule to be able to connect! Commented Mar 21, 2020 at 12:03
  • I have added or allowed my local machine's IP like TYPE protocol port range source Custom TCP TCP 0 42.108.249.55/32 Commented Mar 21, 2020 at 12:19
  • Port is 0? It must be 5432 Commented Mar 21, 2020 at 12:20
  • 1
    thanks @franklinsijo this helped but when others want to access the same instance its not working for them even after allowing their IP address. Moreover my ip keeps changing every now and then so i have to update the rule everytime this happens isnt there any other solution so that i dont have to keep updating them? Commented Mar 21, 2020 at 16:51

1 Answer 1

2

The easiest way would be to add an INBOUND rule to your DB Security group allowing access from anywhere 0.0.0.0/0 for the DB TCP port (in this scenario, it is 5432). This will allow any IP address to access to your publicly accessible DB instance. Please be warned that this brings in its own set of security risks.

To avoid this, commonly used alternative is to connect via a VPN and have the VPN IP address allowed for INBOUND.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.