I am new in AWS VPC. I have question about how to connect mySQLworkbench to RDS in AWS private subnet.
I use VPC wizard to create scenario 2 : VPC with public and private subnets. From a lot of blogs and forums, most of the people recommend the database should be in private subnet, so I created the database in private subnet. I also created NAT gateway (not the instance). Is that anyway I could use mySQLworkbench from public (any) network to connect to the database in private subnet?
Thanks, Angela
Amazon RDS databases can be launched in the public or private subnet of a VPC. Connection problems can be caused by an incorrect VPC configuration or by configuration or connectivity issues on the client that you are connecting from.
I also followed the Scenario 2 in the AWS Documentation without the NAT parts. But now I can't access the RDS instance from my computer because RDS is in a private subnet.
To solve the accessibility problem I got the idea from this tutorial. I actually did not follow it, so I cannot recommend it.
What I actually did was:
1) I created an EC2 instance and gave it an ellastic IP.
2) Then I allowed the DB to receive traffic from this instance (this was already defined on the AWS tutorial, on the DB server Security Group).
3) Then I allowed an SSH connection from my computer to the EC2 instance.
4) Finnaly I was able to connect to the DB using MySQL WorkBench by establishing a connection "Standard TCP/IP over SSH"
The good thing is that this solution can be achieved using only Free Tier resources (at the time of writing) AFAIK.
Use VPN solution such as OpenVPN.
Other way as suggested previously, you can configure ssh bastion host and then use it as jump server to ssh into db instance. Accordingly configure mysqlworkbench connection to reach db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With