If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?
1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.
2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.
3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:
"jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&password=__password__";
and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&password=__password__"
I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.
Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!
Could someone please throw some light on it?
Thanks.