Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A cloud engineer is deploying a new Cloud SQL for SQL Server instance for an enterprise application using the gcloud CLI. The application architecture specifies high availability with automatic failover across two zones in the us-central1 region, private network access within an existing Virtual Private Cloud named prod-vpc, and complete prevention of public IP allocation. Which gcloud command correctly provisions the database instance according to these requirements?

  1. gcloud sql instances create prod-db --database-version=SQL_SERVER_2019_STANDARD --cpu=4 --memory=16GiB --region=us-central1 --availability-type=REGIONAL --network=projects/my-project/global/networks/prod-vpc --no-assign-ipAnswer
  2. B
    gcloud sql instances create prod-db --database-version=SQL_SERVER_2019_STANDARD --cpu=4 --memory=16GiB --region=us-central1 --availability-type=REGIONAL --authorized-networks=0.0.0.0/0
  3. C
    gcloud sql instances create prod-db --database-version=SQL_SERVER_2019_STANDARD --cpu=4 --memory=16GiB --region=us-central1 --availability-type=ZONAL --network=projects/my-project/global/networks/prod-vpc --assign-ip
  4. D
    gcloud sql instances create prod-db --database-version=SQL_SERVER_2019_STANDARD --cpu=4 --memory=16GiB --region=us-central1 --availability-type=REGIONAL --tier=db-custom-4-16000-spot

Answer

The command using --availability-type=REGIONAL together with --network specifying the target VPC path and the --no-assign-ip flag correctly meets all high-availability and private IP requirements.
The correct command provisions a regional Cloud SQL instance (--availability-type=REGIONAL) to ensure zone-redundant high availability, attaches it to the specified VPC network via the --network flag, and explicitly suppresses public IP allocation by setting --no-assign-ip.

Step-by-Step Solution

1
Identify High Availability requirement
Setting --availability-type=REGIONAL configures Cloud SQL with a primary and standby instance in separate zones within the region for automated failover.
ZONAL availability provides single-zone deployment without failover.
2
Identify private IP connectivity requirement
Specifying --network=<VPC_PATH> connects the instance to the private network via Private Service Access.
Private Service Access connects the database directly to the customer VPC.
3
Ensure public IP prevention
Including the --no-assign-ip flag explicitly prevents the creation of a public IPv4 address on the Cloud SQL instance.
By default, Cloud SQL assigns a public IP address unless --no-assign-ip is specified.

Key Concept

Deploying Cloud SQL Instances with Regional High Availability and Private Service Access
Rate this question