2

I'm trying to connect a local Postgres server to an AWS RDS instance. When I enter in the credentials:

enter image description here

I keep getting an error: Unable to connect to server: timeout expired

I searched and it seems to be an issue with the security group. I did the following but it didn't work: https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance

3
  • 2
    Have you enabled your db to be "Publicly accessible" in the rds settings? Commented Apr 13, 2020 at 3:18
  • 1
    That was it. There was one checkbox for Publicly Accessible that I did not check. Thank you. Commented Apr 13, 2020 at 5:40
  • Cool. I will make answer for future reference if you don't mind. Commented Apr 13, 2020 at 5:43

8 Answers 8

8

Based on Jonnel Salvador Dorotan comment on this video https://www.youtube.com/watch?v=3HPq12w-dww I was able to get it to work. Here is his comment pasted:

"For those who are getting this error: "... Connection timed out (0x0000274C/10060)", these are what I did to solve the problem:

  • Go to "Security group rules" (under "Connectivity & security")
  • Click the item "default" Security group
  • Click "Actions" > "Edit inbound rules" > "Add rule"
  • Select... Type: "All traffic", Source: "My IP", then click "Save rules"
Sign up to request clarification or add additional context in comments.

2 Comments

Looks like the accepted answer is an easier solution.
The accepted answer suggests making sure your instance is public. My instance was already public and had a security group with allow-everything inbound rule but still got the timeout error. The error only stopped after following this answer.
7

Based on the comments. The issue was that publicly accessible option in the RDS settings was disabled.

1 Comment

Here's a guide to change the Publicly Accessible. aws.amazon.com/premiumsupport/knowledge-center/…
2

Here are some suggestions/troubleshooting steps you can follow:

  1. Make sure that RDS is in available state an publicly accessible. RDS instance should associated with public subnet.
  2. RDS should be associated with some security group. Check rules associated with security group so that it allows traffic related to the source in and out of the DB instance. You can specify an IP address or a range of IP addresses related to source.
  3. Network ACLs. Network ACLs act as a firewall for resources in a specific subnet in a VPC. If you use ACLs in your VPC, be sure that they have rules that allow inbound and outbound traffic to and from the DB instance.
  4. Check with your local firewall setup to determine if your network allows traffic to and from the ports the DB instance uses for inbound and outbound communication.

Please refer this page. This might help you.

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

Comments

1

Set inbound rules in aws to accept all traffic, select My Ip then save

Go to Modify database in aws then select security group under Network & Security. Select the security group identifier from the dropdown.

Comments

1

I had the same issue, just edit imbound rules, add a new rue, add PostgresSQL as the type, then make it 0.0.0.0/0, this will work fine

Comments

0

I had this same issue. In my case, my home IP had changed, and I needed to adjust the Inbound Rule for "My IP" as described in Maxime's answer.

Comments

0

Addition to some of the above suggestions, make sure the Route Table attached to your public subnet:

  • has been set as main route table. To do this: go to VPC dashboard in AWS console >> Select "Route tables" option from the left link >> Select your route table >> From the "Actions" button click on "Set main route table" from the dropdown menu
  • has the route for the Internet Gateway that you're using in your VPC. You can check this on the "Routes" tab in the lower pane of your route table.

Comments

0

In the case of IPV6, try adding IPV6 ALL in the outbound rules as well.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

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.