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?
- gcloud sql instances create analytics-db --database-version=POSTGRES_15 --region=us-central1 --authorized-networks=198.51.100.0/24 --storage-auto-increaseAnswer
- Bgcloud sql instances create analytics-db --database-version=POSTGRES_15 --region=us-central1 --assign-ip --storage-auto-increase
- Cgcloud sql instances create analytics-db --database-version=POSTGRES_15 --zone=us-central1 --authorized-networks=198.51.100.0/24 --auto-storage-increase
- Dgcloud 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
Key Concept
Provisioning Cloud SQL instances via gcloud CLI with network access controls and automatic storage growth.