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

IamWarmduscher
  • 875
  • 2
  • 10
  • 27

7 Answers7

6

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

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 1
    Here's a guide to change the Publicly Accessible. https://aws.amazon.com/premiumsupport/knowledge-center/rds-connectivity-instance-subnet-vpc/ – Pablo LION Apr 12 '22 at 16:54
4

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"
2

Here is 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.
  2. 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

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.

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.

ddr
  • 1
  • 1
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.
A K
  • 31
  • 4
0

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

Satyam
  • 1
  • 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](/help/how-to-answer). – Community Feb 23 '23 at 21:55