Google Cloud Professional Cloud Developer — Question 342

You are developing an application that needs to connect to a Cloud SQL for PostgreSQL database by using the Cloud SQL Auth Proxy. The Cloud SQL Auth Proxy is hosted in a different Google Cloud VPC network. The Cloud SQL for PostgreSQL instance has public and private IP addresses. You are required to use the private IP for security reasons. When testing the connection to the Cloud SQL instance, you can connect by using the public IP address, but you are unable to connect by using the private IP address. How should you fix this issue?

Answer options

Correct answer: C

Explanation

The correct answer is C because VPC Network Peering allows the two VPCs to communicate privately, enabling access to the Cloud SQL instance via its private IP. Options A and B do not address the networking issue, while option D is unnecessary if the network configuration is not set up correctly.