CLOUD-DATABASE-ENGINEER practice question 19 of 25

You are migrating an on-premises application to Compute Engine and Cloud SQL. The application VMs will live in their own project, separate from the Cloud SQL instances which have their own project. What should you do to configure the networks?

Full set: 141 questions
Answer options
A: Create a new VPC network in each project, and use VPC Network Peering to connect the two together.
B: Create a Shared VPC that both the application VMs and Cloud SQL instances will use. Correct answer
C: Use the default networks, and leverage Cloud VPN to connect the two together.
D: Place both the application VMs and the Cloud SQL instances in the default network of each project.
Correct Answer:
B. Create a Shared VPC that both the application VMs and Cloud SQL instances will use.
Explanation

Shared VPC is the ideal solution for this scenario. It allows an organization to connect resources from multiple projects to a common, centrally managed Virtual Private Cloud (VPC) network. By designating a host project to own the VPC and attaching the application and Cloud SQL projects as service projects, you enable resources in both projects to communicate securely and efficiently using internal IP addresses. This maintains administrative and billing separation at the project level while providing unified network connectivity, which is a Google Cloud best practice for multi-project architectures.

Why Incorrect

A: Cloud SQL uses Private Service Access, which is a specific peering type to a Google-managed VPC, not a direct peering between two customer-managed VPCs as this option implies. C: Using Cloud VPN to connect two VPCs within Google Cloud is inefficient. It introduces unnecessary latency, complexity, and cost compared to native solutions like Shared VPC. D: Placing resources in the default network of each project does not provide connectivity between them. The networks would remain isolated without a peering or Shared VPC configuration.

References

1. Shared VPC Overview: Google Cloud Documentation, "Shared VPC overview". This document states, "Shared VPC allows an organization to connect resources from multiple projects to a common Virtual Private Cloud (VPC) network so that they can communicate with each other securely and efficiently using internal IPs from that network." This directly addresses the question's requirement.

2. Cloud SQL with Shared VPC: Google Cloud Documentation, "Configure a Cloud SQL instance on a Shared VPC network". This guide confirms the validity of the proposed solution: "You can create a Cloud SQL instance as a service project of a Shared VPC. This lets the Cloud SQL instance be accessed from other service projects in the Shared VPC network."

3. Private Service Access: Google Cloud Documentation, "Private Service Access". This explains that connecting to Cloud SQL via private IP uses a peering connection to a Google-managed service producer network, which clarifies why option A's description of peering two customer projects is imprecise for this use case.

Scroll to Top