skip to Main Content

I’ve been struggling with this for 2 days now. Did a lot of research and troubleshooting for the most obvious things related to the connection. I’ll enumerate all I did and how is everything is setup.

  1. I created a custom VPC for this in the 10.0.0.0/16 CIDR

  2. I created 6 subnets, 2 public, 2 private and 2 db public subnets.
    enter image description here

  3. Created the route tables for the subnets.
    enter image description here

  4. The public subnet and the db subnet have a route to the IGW
    enter image description here

  5. The internet gateway is attached to the VPC.
    enter image description here

  6. The database has been created with "public access" and also in the public db subnets.
    enter image description here

  7. The Security Group has been updated with inbound rule. Eventually I would like to only connect from a given set of IPs but for now I’m opening to all IPs for troubleshooting.
    enter image description here

So until this point according to all the tutorials, videos that I’ve watched I should be able to connect to the RDS instance.

One of the suggested troubleshooting steps was to try and TELNET into the instance.
I redacted the endpoint but that’s the one I got from the RDS panel.

➜  proj git:(main) ✗ telnet REDACTED.REDACTED.us-west-1.rds.amazonaws.com 5432
Trying XX.XXX.39.69...
telnet: connect to address XX.XXX.39.69: Operation timed out
telnet: Unable to connect to remote host

Another suggestion was to try from a different network. I did try on cellular data and also from a VPS in DigitalOcean, same effect.

Hope someone can guide me on this because it’s driving me crazy…

EDIT1: ENI Public IP address does match the resolved IP from TELNET
enter image description here
enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I ended up creating a new AWS account and run the exact same configuration and it worked without any issue... I found some other reports were people are experiencing the same issue (see link below). Apparently it happens for accounts that were blocked/restricted and when they lift the restriction something stays broken. Sad news is that it requires technical assistance from AWS to solve and they won't accept the issue without raising a technical issue which requires a subscription...

    SSH connection drops after couple seconds on every new instance EC2, then any attempt to reconnect always return connection timed out error

    FINAL RESOLUTION FROM AWS.

    I did some research using internal tool and see that resources in your account are under restricted access. I see that account was reinstated recently from suspended state. When account are suspended, the resources in all the region will be in restricted access. After the account reinstated, this restriction should be removed in every region manually. I assume this was not done from our end thus I see the restriction.

    Please accept my apologize on behalf of the AWS for the inconvenience caused due to the same.

    Moving further, I contacted my internal team and got the restriction removed in all the region for your account. I can confirm the restriction has been removed now. Please confirm whether you could connect to instance now.

    I once again apologize for the inconvenience caused. Please do not hesitate to get back to me if you have any other queries. I will be happy to assist you.

    Thank you and have a nice day!

    We value your feedback. Please share your experience by rating this and other correspondences in the AWS Support Center. You can rate a correspondence by selecting the stars in the top right corner of the correspondence.

    Best regards, Ruchikka C. Amazon Web Services


  2. To reproduce your situation, I did the following:

    • Created a VPC across 2 AZs, each with 1 Public, 1 Private and 1 "DB" subnet

    VPC Architecture

    (I then renamed private3 and private4 as my DB subnets.)

    • Edited the route table associate with the "DB" Subnets:

    Route Table

    • Made sure that Route Table was associated with my "DB" subnets:

    Subnet associations

    • Created a new DB Subnet Group containing the two "DB" subnets

    • Launched an Amazon RDS Database:

      • PostgreSQL 14.6
      • Dev/Test, Single DB instance
      • Instance type: db.t3.micro
      • Public access = Yes
      • Used the above DB Subnet Group
      • Create new Security Group
    • Confirmed that the auto-created security group permits Inbound port 5432 to my IP address (It did!)

    • Connected to the database using psql from my laptop:

    psql -h stack-db.cdigff1pjpzh.ap-southeast-2.rds.amazonaws.com -U postgres 
    Password for user postgres: 
    
    psql (15.2, server 14.6)
    SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, compression: off)
    Type "help" for help.
    
    postgres=>
    

    It connected just fine!

    Please compare my steps with yours to see what might be different.

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