Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A cloud engineer needs to deploy a Cloud SQL for PostgreSQL instance named analytics-db in the us-central1 region using the gcloud CLI. The deployment must strictly enforce private IP connectivity on the custom VPC network prod-vpc without allocating a public IP address, and must ensure high availability across multiple zones. Which TWO flags must be included in the gcloud sql instances create command to meet these requirements? (Select TWO.)

  1. --network=prod-vpc and --no-assign-ipAnswer
  2. --availability-type=REGIONALAnswer
  3. C
    --assign-ip and --authorized-networks=0.0.0.0/0
  4. D
    --availability-type=ZONAL

Answer

The correct options are specifying '--network=prod-vpc and --no-assign-ip' to enforce private IP connectivity without a public IP, and '--availability-type=REGIONAL' to configure high availability.
Combining '--network=prod-vpc and --no-assign-ip' ensures that the Cloud SQL instance is accessible exclusively via private IP within the designated VPC network without exposing a public IP address. Adding '--availability-type=REGIONAL' provisions failover infrastructure across multiple zones for high availability.

Step-by-Step Solution

1
Determine private IP configuration flags for Cloud SQL CLI deployment.
Using --network=prod-vpc routes database connections through Private Service Access, and --no-assign-ip explicitly disables public IP allocation.
Cloud SQL instance creation creates a public IP by default unless --no-assign-ip is provided alongside the target VPC network.
2
Determine high availability deployment configuration flags.
Setting --availability-type=REGIONAL configures primary and standby database instances across distinct zones within the specified region.
A REGIONAL configuration provides automatic synchronous replication and high availability failover capabilities.

Key Concept

Deploying Cloud SQL with Private IP and High Availability
Rate this question