1

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?

VivekGhosh
  • 85
  • 1
  • 8
  • https://stackoverflow.com/questions/53612459/how-to-connect-to-a-remote-mysql-over-ssh-tunnel-in-spring-boot-application/53627496 https://stackoverflow.com/questions/48296313/connect-to-mysql-through-ssh-and-by-using-spring-boot – Yayotrón May 17 '21 at 12:41
  • Yeah I saw those other questions - thing is they don't give a very elegant solution, anyway to define a custom datasource with SSH tunnelling? – VivekGhosh May 17 '21 at 16:08

0 Answers0