Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A system administrator is deploying a production Cloud SQL for MySQL database named `corp-db` in the `us-central1` region. The instance must be configured with High Availability for multi-zone redundancy and must be restricted to internal network traffic within an existing VPC network named `prod-vpc`. Which TWO configuration steps must be performed to meet these requirements?

  1. Establish a private services access connection (VPC Network Peering) between `prod-vpc` and Google Service Networking before creating the instance.Answer
  2. Include the `--availability-type=REGIONAL` flag when running the `gcloud sql instances create` command.Answer
  3. C
    Assign a public IP address to the database instance with an authorized network entry configured for `0.0.0.0/0`.
  4. D
    Create a new subnet in `prod-vpc` using the `gcloud compute networks subnets create` command with the `--enable-private-ip-only` flag.

Answer

To configure a high-availability Cloud SQL instance accessible strictly via Private IP, you must establish a private services access connection between your VPC network and Google Service Networking, and specify `--availability-type=REGIONAL` when running `gcloud sql instances create`.
Establishing a private services access connection enables private IP routing between your VPC network and the Google service producer network, while the `--availability-type=REGIONAL` flag provisions a standby failover instance in a secondary zone to satisfy high availability requirements.

Step-by-Step Solution

1
Allocate an IP range and create a private services access connection in the target VPC network (`prod-vpc`).
Establishes VPC Network Peering between `prod-vpc` and the internal Google-managed infrastructure hosting Cloud SQL.
Cloud SQL managed instances run inside a Google-owned VPC network; private IP communication requires Private Service Networking peering.
2
Deploy the Cloud SQL instance using `gcloud sql instances create corp-db --network=prod-vpc --no-assign-ip --availability-type=REGIONAL --region=us-central1`.
Provisions a high-availability database instance with a primary zone and standby zone, bound strictly to the internal network.
Specifying `--availability-type=REGIONAL` ensures regional redundancy and failover capability, while referencing the network ensures Private IP assignment.

Key Concept

Configuring Cloud SQL High Availability and Private IP Connectivity
Rate this question