skip to Main Content

I created my Postgres database in AWS but it has connection timeouts every time I try to connect (using JDBC or pgadmin). I even added security groups but that didn’t help.
Text
Text
Since I’m new in AWS I really have no idea what to do. Should I check any logs or I missed something during set-up?

2

Answers


  1. From where are you trying to connect?
    If you’re trying from a local machine, the DB must be deployed in a public subnet, and must have a public IP.

    Login or Signup to reply.
  2. Some things to check:

    • Database was launched with Publicly Available = Yes (Done!)
    • Security Group permits inbound access from your IP address or 0.0.0.0/0 (Done!)
    • DNS Name resolves to a public IP address (I checked, it does!)
    • Database was launched in public subnets (Defined as having a Route Table entry pointing to an Internet Gateway)
    • Your network permits the traffic (can test on different networks, eg Home vs Office vs Tethered via your phone)

    I tried connecting from my computer and it timed-out too, and I know that my "network permits" such traffic.

    Therefore, it seems likely that the database was launched with a subnet group that contained only private subnets, which are not reachable from the Internet.

    Update:

    It appears that the database has been launched with a Subnet Group that contains private subnets rather than public subnets.

    If you have not yet connected to the database / stored any data, it would be easiest to:

    • Delete the current Amazon RDS instance
    • Create a Subnet Group that contains public subnets
    • Launch a new Amazon RDS instance using the new Subnet Group

    For security, you should adjust the Security Group to only allow access from your IP address (removing the entries for 0.0.0.0/0).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search