Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A data engineering team needs to provision a new Cloud SQL for PostgreSQL instance named `analytics-db` in the `us-central1` region. Security policy specifies that if a public IP is enabled on the instance, connectivity must be restricted exclusively to the corporate network IP range `198.51.100.0/24`. Furthermore, to avoid database outage caused by running out of disk space, automatic storage capacity expansion must be configured during deployment. Which `gcloud` command correctly deploys the database instance according to these requirements?

  1. gcloud sql instances create analytics-db --database-version=POSTGRES_15 --region=us-central1 --authorized-networks=198.51.100.0/24 --storage-auto-increaseAnswer
  2. B
    gcloud sql instances create analytics-db --database-version=POSTGRES_15 --region=us-central1 --assign-ip --storage-auto-increase
  3. C
    gcloud sql instances create analytics-db --database-version=POSTGRES_15 --zone=us-central1 --authorized-networks=198.51.100.0/24 --auto-storage-increase
  4. D
    gcloud bigtable instances create analytics-db --cluster=analytics-cluster --cluster-zone=us-central1-a --display-name="Analytics DB"

Answer

The command 'gcloud sql instances create analytics-db --database-version=POSTGRES_15 --region=us-central1 --authorized-networks=198.51.100.0/24 --storage-auto-increase' correctly provisions the Cloud SQL for PostgreSQL instance in us-central1, limits public network ingress to 198.51.100.0/24, and enables dynamic storage capacity expansion.
The correct option executes 'gcloud sql instances create' with '--region=us-central1', specifies '--authorized-networks=198.51.100.0/24' to restrict public connectivity to the corporate CIDR range, and sets '--storage-auto-increase' to automatically scale storage capacity when needed.

Step-by-Step Solution

1
Identify the managed database service required by the workload.
Cloud SQL for PostgreSQL requires using the 'gcloud sql instances create' group command.
Cloud SQL is the managed relational database service in Google Cloud for PostgreSQL workloads.
2
Specify network access restrictions for public IP endpoints.
Pass '--authorized-networks=198.51.100.0/24' to limit incoming connections to the corporate network.
Without authorized network CIDR restrictions, instances with public IP addresses permit access from any source IP.
3
Configure storage autoscaling flags during creation.
Include the '--storage-auto-increase' flag in the deployment command.
This setting allows Google Cloud to automatically expand disk storage when available capacity drops low, avoiding database outages.

Key Concept

Provisioning Cloud SQL instances via gcloud CLI with network access controls and automatic storage growth.
Rate this question