Not able to connect AWS RDS instance?

Prajapati Mehul
2 min readNov 10, 2021

Hello Guys,

if you have created a new DB in AWS rds and trying to connect it and having an AWS RDS timeout error or are somehow not able to connect to RDS then you can solve the problem using the below guide

When you launch the RDS instance in aws it is by default launched in Default VPC and default security group so if you have not changed any default setting for VPC and security group then RDS is in private VPC

it means AWS RDS is not accessible from the internet and only can be accessed from the same VPC resources so if you launch an EC2 instance in the Same VPC and try to connect RDS from that EC2 then it will connect without giving a connection timeout error because it's in the Same VPC

and connecting RDS from the internet is not a good idea because it contains data and it should not be directly accessible from the internet, so to connect secure RDS you can use SSH tunneling or the Bastion host method.

If you still want to connect RDS from an outside or a local machine then here is the process

Step 1: RDS Publicly accessible check

Go to RDS which you have created and look at Connectivity & security tab, inside this tab you can find one parameter called Publicly accessible, if it is yes then your RDS can be connected from the Internet and something else is still wrong here

Step 2 : Security Group Check

Your RDS is having a default security group if you have not changed, then it will not have the port open to allow connection from outside

so you have to check if the port is open or not, for that go to the same tab Connectivity and security, there you will find security group connected with RDS, now open the Security group and check for the Inbound rules

you can see their port for MySQL is open to the world, which means it can be connected from the internet, so you also have to edit inbound rules and select anywhere-ipv4, so your RDS can access from your local machine

Thanks for reading.
Please Follow me if you liked the content!

--

--

Prajapati Mehul

AWS DevOps Engineer, Enthusiastic learner, Equity Investor, Avid Reader