Cloud Run app must connect to a Cloud SQL database located in a different project on an isolated network with no public IP. How should you connect?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a subnet on your VPC; create a Serverless VPC Access connector in your project using that subnet; in Cloud Run create a Cloud SQL connection; use Cloud SQL Language Connectors..
Why this is the answer
To connect Cloud Run to a private Cloud SQL instance in a different project, you need a Serverless VPC Access connector. This connector must be in the same project as your Cloud Run service and connect to a subnet within your VPC network. This allows Cloud Run to send traffic to your VPC, which can then reach the Cloud SQL instance via its internal IP address. Cloud SQL Language Connectors are the recommended way to establish the database connection from your application code. The other options are incorrect because: Private Service Connect is for connecting to services in other VPCs, but Cloud SQL is typically accessed via Private IP within a VPC. VPC Network Peering is not directly used by Cloud Run for private connections; Serverless VPC Access is required. Configuring private services access is for the project hosting Cloud SQL, not directly for Cloud Run's outbound connection.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed