C2W1 - Graded Assignment 1: Can't connect Cloud9 to RDS

Hello, I’ve done everything shown in the accompanying lab walkthrough to connect to the RDS Postgres instance but after entering the psql --host=de-c2w1a1.us-east-1.rds.amazonaws.com --user=postgres --password --host=5432 command, it still hangs. Is there some other steps needed that are not mentioned in the lab walkthrough?

Hello @Abdullah3
Up until step 2.14, the connections are supposed to fail. For educational purposes, you try different things in this lab that will lead to failed connections, and you will get to fix the issues one by one. But do you mean you still can’t connect to the database in step 2.14?

I can’t connect to the database even after the step where in the lab walkthrough the connection becomes succesful. I’ve tried it on 2 different laptops 4 times. I create the cloud9 environment named de-c2w1a1, selected the t3.small as the instance type, selected SSH for the connection type and selected the dec2w1a1 VPC with the public subnet. Then added an inbound rule to the RDS security group to allow traffic from port 5432 from the cloud9 instance’s security group. After following all these steps, the cloud9 instance still cannot connect to the RDS instance.

@Abdullah3 Unfortunately, I was not able to reproduce the issue. I did the following, and the connection works.

  1. Created a cloud9 environment in the de-c2w1a1 VPC and the public subnet de-c2w1a1-public-subnet-a
  2. Went to security groups, chose the RDS database security group, and added the inbound rule with the Cloud9 instance security group in the Source field. It looks like this:
  3. Ran aws rds describe-db-instances --db-instance-identifier de-c2w1a1-rds --output text --query "DBInstances[].Endpoint.Address" to get the RDS database endpoint.
  4. Replaced this endpoint in the connection command. It looked like this:
    psql --host=de-c2w1a1-rds.ch6w6k8kca5x.us-east-1.rds.amazonaws.com --username=postgres --password --port=5432

Please, check the steps one by one to figure out what’s going wrong in your case. I suggest reassuring that you choose enter the correct security group in the Source field of the inbound rules. Also, please reassure that you save the changes made to the inbound rules.