GoogleGoogle Professional Cloud Developer (PCD) Certification·EN·Updated 3 Sep 2026
You need Cloud Run to connect to a PostgreSQL database while keeping traffic private and using managed services and recommended practices. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable Cloud SQL and Cloud Run in the same project; configure Cloud SQL with a private IP and enable Private Services Access; create a Serverless VPC Access connector; configure Cloud Run to use the connector to connect to Cloud SQL..
Why this is the answer
The correct solution uses Cloud SQL, a fully managed PostgreSQL service, which aligns with the requirement for managed services. Configuring Cloud SQL with a private IP and enabling Private Services Access ensures private traffic within Google's network. A Serverless VPC Access connector allows Cloud Run (a serverless service) to connect to resources within a VPC network, such as Cloud SQL's private IP. Keeping Cloud SQL and Cloud Run in the same project simplifies management and networking.
Using Compute Engine VMs for PostgreSQL (options 2 and 4) is not a fully managed solution. Using different projects and a VPN (options 3 and 4) adds unnecessary complexity and cost for a common use case that can be handled within a single project.