Operation Timeout Error When Connecting to RDS PostgreSQL Instance

0

I am trying to set up a Drupal project using Apache and I am using PostgreSQL for my database. I have set up my EC2 and RDS instances and I have checked my configurations several times, but I keep getting a timeout error "psql: error: connection to server at "my-project-name.c36kus0eomi1.us-east-1.rds.amazonaws.com" (172.31.47.29), port 5432 failed: Operation timed out Is the server running on that host and accepting TCP/IP connections?". I was trying to follow along with an AWS tutorial 'Deploy Drupal with Amazon RDS' and it seems to leave out some information. I tried to run the ping command 'ping mel-boyajian-db.c36kus0eomi1.us-east-1.rds.amazonaws.com

PING my-project-name.c36kus0eomi1.us-east-1.rds.amazonaws.com (172.31.47.29): 56 data bytes' and it also timed out. Does it have anything to do with not having completed the DB name in the additional configurations when I was setting up the RDS instance? I have a DB identifier but nothing was entered in the Db name field 'DB name -'. I also noticed in the VPC settings Network ACLs that the '*' rule number says 'Deny' but it is grayed out and uneditable. Deny warning

These are my security groups: Security groups And their rules: Launch wizard Inbound Launch wizard Outbound Default Inbound Default Outbound This is my first time working with AWS so please forgive my ignorance and thanks for any help.

2 Answers
0

Hello.

What are the network ACL outbound rules configured?
Network ACLs are stateless inspections, so inbound and outbound communication must be allowed.
There is no problem if the first rule is set to allow all communications.

Does it have anything to do with not having completed the DB name in the additional configurations when I was setting up the RDS instance?

I don't think it matters whether you enter the DB name or not.
Can you confirm that the RDS security group uses the security group named "default"?

By the way, if you create RDS using the steps in the document below, you can automatically create a security group for connecting to RDS from EC2.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/option2-task2-create-rds-database.html

profile picture
EXPERT
answered a month ago
  • The Network ACLs outbound configs are '100' and '*' 100 All traffic All All 0.0.0.0/0 Allow * All traffic All All 0.0.0.0/0 Deny. To answer your other question, the RDS security group does use the group named "default." sg-0d6c9eea44eeec636 default vpc-08707e7a12bf3c5a4 default VPC security group 590183864514 1 Permission entry 1 Permission entry

    VPC security groups default (sg-0d6c9eea44eeec636) Inbound: sgr-0b11ceaa532cbe397 – PostgreSQL TCP 5432 sg-0d929e2cfeec72a82 / launch-wizard-1 – Outbound: sgr-069e0e9ab3429ebaa IPv4 All traffic All All 0.0.0.0/0 –

  • Is the EC2 security group set to "launch-wizard-1"? Is the correct port number set on the RDS side? You can check from the "Connectivity & security" tab of the RDS instance. Also, make sure you haven't selected the wrong database engine.

  • The database engine is definitely PostgreSQL. The EC2 security group is set to 'launch-wizard-1.' And my RDS endpoint is copy and pasted when I am trying to connect so I know the endpoint os correct. The port is 5432. Additionally I changed the configurations with my postgresql.conf file to allow permissions set to the private IPv4 address.

0

Hello,

Please try this solution.

when connecting to your RDS PostgreSQL instance from an EC2 instance, verify that the security group associated with your RDS instance permits inbound traffic at your port number from the security group of your EC2 instance. confirm that the security group associated with your EC2 instance allows outbound traffic. Confirm that both your EC2 and RDS instances are in the same VPC and subnet, or appropriately configured for VPC peering. Once these settings are confirmed, SSH into your EC2 instance and use "Telnet" to test connectivity to the RDS endpoint at your port number. This setup confirms that network and security configurations permit the necessary communication between your EC2 instance and the RDS database.

if you need more information please go through the AWS Document below link.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/tutorial-connect-ec2-instance-to-rds-database.html

EXPERT
answered a month ago