PROFESSIONAL-CLOUD-DEVELOPER · Question #134
Your team is developing a new application using a PostgreSQL database and Cloud Run. You are responsible for ensuring that all traffic is kept private on Google Cloud. You want to use managed services
The correct answer is A. 1. Enable Cloud SQL and Cloud Run in the same project. 2. Configure a private IP address for. The Google-recommended best practice for a fully managed, private PostgreSQL setup with Cloud Run is: (1) Use Cloud SQL (managed PostgreSQL) in the same project as Cloud Run, (2) configure a private IP address on the Cloud SQL instance so it is only reachable within the VPC, and
Question
Your team is developing a new application using a PostgreSQL database and Cloud Run. You are responsible for ensuring that all traffic is kept private on Google Cloud. You want to use managed services and follow Google-recommended best practices. What should you do?
Options
- A
- Enable Cloud SQL and Cloud Run in the same project. 2. Configure a private IP address for
- B
- Install PostgreSQL on a Compute Engine virtual machine (VM), and enable Cloud Run in the
- C
- Use Cloud SQL and Cloud Run in different projects. 2. Configure a private IP address for Cloud
- D
- Install PostgreSQL on a Compute Engine VM, and enable Cloud Run in different projects. 2.
How the community answered
(33 responses)- A82% (27)
- B3% (1)
- C6% (2)
- D9% (3)
Explanation
The Google-recommended best practice for a fully managed, private PostgreSQL setup with Cloud Run is: (1) Use Cloud SQL (managed PostgreSQL) in the same project as Cloud Run, (2) configure a private IP address on the Cloud SQL instance so it is only reachable within the VPC, and (3) connect Cloud Run to the VPC using Serverless VPC Access or Direct VPC Egress, enabling private connectivity without traffic traversing the public internet. This uses fully managed services (Cloud SQL, Cloud Run) with no VMs to maintain. Options B and D require installing PostgreSQL on Compute Engine VMs, abandoning the managed service requirement. Option C places Cloud SQL and Cloud Run in different projects, which adds significant networking complexity (VPC peering, Shared VPC) and is not the recommended pattern for keeping traffic private with minimal operational overhead.
Topics
Community Discussion
No community discussion yet for this question.