In Spring - How to connect to AWS RDS via a EC2 bastion host?

1.2k views Asked by At

I have a AWS RDS MySQL instance running, on a private subnet. I have another EC2 instance running on a public subnet, which functions as a bastion host for the MySQL instance. They are both in the same VPC.

I can connect to said instance via the mySQL workbench by configuring a Standard TCP/IP over SSH connection. I provide the SSH Hostname as the EC2 public IPv4 DNS, SSH Key file and the MySQL hostname and credentials.

I can't quite figure out how to connect to this db through a local springboot application. Any explanations would be helpful.

As in what should be the JDBC URL, and how do I get the application to route via the bastion host?

0

There are 0 answers