Google Cloud Professional Cloud Developer — Question 317
You are responsible for developing a new ecommerce application that is running on Cloud Run. You need to connect your application to a Cloud SQL database that is in a separate project. This project is on an isolated network dedicated to multiple databases without a public IP. You need to connect your application to this database. What should you do?
Answer options
- A. Create a Private Service Connect endpoint on your network. Create a Serverless VPC Access connector on your project. Use Cloud SQL Language Connectors to create an internal connection.
- B. Configure VPC Network Peering between both networks. In Cloud Run, create a Cloud SQL connection that uses the internal IP. Use Cloud SQL Language Connectors to interact with the database.
- C. Configure private services access on your project. In Cloud Run, create a Cloud SQL connection. Use Cloud SQL Language Connectors to interact with the database.
- D. Create a subnet on your VPC. Create a Serverless VPC Access connector on your project using the new subnet. In Cloud Run, create a Cloud SQL connection. Use Cloud SQL Language Connectors to interact with the database.
Correct answer: D
Explanation
The correct answer is D because creating a subnet and a Serverless VPC Access connector allows Cloud Run to connect to the private Cloud SQL database without needing a public IP. Options A and B suggest methods that do not directly create the necessary private connection to Cloud SQL, while option C lacks the requirement for establishing a subnet and VPC Access connector needed for secure access.