Reputation: 1105
I created several instances of RDS with PostgreSQL and get the same problems:
I attached the information of the . Hope someone can help me with this problem. Thank you in advance.
Upvotes: 34
Views: 55178
Reputation: 1105
Finally, I found the answer for my problem. For the error of "connection timeout", one of the reasons can be from the security settings. Although I set it as public when creating the RDS instance, the instance is attached with a private VPC security group which is not exposed publicly.
I can access to RDS from the same IP address that I'm on when I created it. When I go to other place (or switching VPN), I'm unable to connect it. That explains the intermittent connection.
We can attach the RDS instance with a public security group inside the VPC (I don't think it is a good setting, just for the beginner in AWS like me) as below:
Upvotes: 60
Reputation: 11
In my case, I did not set up internet gate. Check your db's route table in VPC. And, add internet gateway
Upvotes: 1
Reputation: 860
I faced the same issue and it end up because of the VPN am using, when i disconnected the VPN i apply to connect.
Upvotes: 0
Reputation: 65534
I just followed the guide: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html
Run through the typical things:
Make sure the Database is Public! Check in the AWS Website Console, if its Private make it public.
Check you have the Firewall port open for the software and the port you're trying to connect through.
When you create a dB in RDS a Security Group is created automatically with the Rule All, All:
You can add a rule for TCP Port 5432, like I have above.
Check Username/Password - sometimes incorrect ones get cached.
Try to ping the dB to see if its a internet connection problem.
Upvotes: 9
Reputation: 13992
I had to add/edit a rule to the VPC to allow connections from All sources.
Steps:
Under Security > Security Groups > open sg-[something] for which VPC ID matches the DB VPC
Inbound Rules > Edit Rules > Change Source to anywhere
So it seems that even when creating the DB and selecting allow public access, it only includes the traffic from withing the VPC. By doing the above steps you can allow access to all sources.
Upvotes: 25