You are developing a new application on a VM that is on your corporate network. The application will use Java Database Connectivity (JDBC) to connect to Cloud SQL for PostgreSQL. Your Cloud SQL instance is configured with IP address 192.168.3.48, and SSL is disabled. You want to ensure that your application can access your database instance without requiring configuration changes to your database. What should you do?
- ADefine a connection string using your Google username and password to point to the external (public) IP address of your Cloud SQL instance.
- BDefine a connection string using a database username and password to point to the internal (private) IP address of your Cloud SQL instance.
- CDefine a connection string using Cloud SQL Auth proxy configured with a service account to point to the internal (private) IP address of your Cloud SQL instance. (correct answer)
- DDefine a connection string using Cloud SQL Auth proxy configured with a service account to point to the external (public) IP address of your Cloud SQL instance.
Reveal answer & explanationHide answer
The correct answer is C. Option C: Define a connection string using Cloud SQL Auth proxy configured with a service account to point to the internal (private) IP address of your Cloud SQL instance.
Explanation
Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover. A service account provides an identity for workloads to access Google Cloud APIs securely.