Question

Difficulty: Very hardDeploying and Configuring Managed Database Instances

A system administrator needs to provision a production-grade PostgreSQL database on Cloud SQL using the Google Cloud CLI. The compliance policy mandates that the instance must be attached strictly to a custom Virtual Private Cloud (VPC) network without a public IP address, must be configured for High Availability (regional failover), and must support Point-in-Time Recovery (PITR) alongside daily automated backups. Which `gcloud sql instances create` command configuration satisfies all specified enterprise requirements?

  1. gcloud sql instances create prod-db --database-version=POSTGRES_15 --cpu=4 --memory=16GiB --region=us-central1 --network=custom-vpc --no-assign-ip --availability-type=REGIONAL --backup-start-time=02:00 --enable-point-in-time-recoveryAnswer
  2. B
    gcloud sql instances create prod-db --database-version=POSTGRES_15 --tier=db-custom-4-16384 --region=us-central1 --network=custom-vpc --authorized-networks=0.0.0.0/0 --availability-type=ZONAL --enable-bin-log
  3. C
    gcloud sql instances create prod-db --database-version=POSTGRES_15 --tier=db-custom-4-16384 --region=us-central1 --private-ip-only --network=custom-vpc --high-availability=true --pitr=enabled
  4. D
    gcloud sql instances create prod-db --database-version=POSTGRES_15 --tier=db-custom-4-16384 --region=us-central1 --network=custom-vpc --availability-type=REGIONAL --enable-point-in-time-recovery

Answer

The command that uses `--network=custom-vpc` along with `--no-assign-ip`, `--availability-type=REGIONAL`, `--backup-start-time`, and `--enable-point-in-time-recovery` fully satisfies all requirement criteria.
The correct command explicitly suppresses public IP allocation using `--no-assign-ip` while attaching to the specified VPC network via `--network`. It also configures multi-zone regional failover using `--availability-type=REGIONAL` and enables continuous WAL archiving required for PostgreSQL point-in-time recovery via `--enable-point-in-time-recovery` and `--backup-start-time`.

Step-by-Step Solution

1
Evaluate network connectivity requirements
Identify that allocating a private IP without a public IP requires specifying `--network=[VPC_NAME]` and explicitly passing `--no-assign-ip` to disable the default public IP allocation.
If `--no-assign-ip` is omitted, Cloud SQL assigns both a public IP and a private IP by default.
2
Evaluate high availability configurations
Determine that regional failover across primary and standby zones is enabled via `--availability-type=REGIONAL`.
Setting `--availability-type=ZONAL` creates a single-zone instance without automatic failover capabilities.
3
Evaluate backup and point-in-time recovery flags for PostgreSQL
Verify that `--backup-start-time` combined with `--enable-point-in-time-recovery` provides continuous write-ahead log (WAL) archiving for PostgreSQL.
Flags such as `--enable-bin-log` apply only to MySQL engines, whereas `--enable-point-in-time-recovery` is the valid flag for PostgreSQL in `gcloud sql`.

Key Concept

Cloud SQL CLI Provisioning and Security Configuration
Rate this question