Using Cloud SQL Proxy
Before getting started on updating our application to use Cloud SQL Proxy to connect to our Cloud SQL instance, it is important to understand why we use it.
Cloud SQL Proxy provides us with access to Cloud SQL instances without having to whitelist IP addresses or configure SSL. This means we get secure connections without complex configuration and easier connection management as Cloud SQL Proxy handles authentication with Cloud SQL. Because we don't need whitelisting or other such network security measures when using Cloud SQL Proxy, it uses a service account to authenticate with the Cloud SQL instance. Finally, Cloud SQL Proxy handles the failover from the primary to the standby Cloud SQL instance if the primary Cloud SQL instance becomes unresponsive.
Let's get started with installing and configuring Cloud SQL Auth Proxy by performing the following steps:
- In our Tomcat virtual machine, enter the following command to download the Cloud...