A DevOps team is deploying a production Cloud SQL for PostgreSQL instance named `app-postgres-db` using the Google Cloud CLI. The deployment policies mandate three strict requirements: the instance must communicate exclusively over Private IP within the existing Virtual Private Cloud (VPC) network `internal-vpc`, public IP address allocation must be explicitly disabled, and all incoming client connections must enforce SSL/TLS encryption. Additionally, the instance must automatically increase storage space when available capacity drops below the safety threshold. Which `gcloud` command should the engineer run to provision the database instance according to these requirements?
- gcloud sql instances create app-postgres-db --database-version=POSTGRES_15 --tier=db-custom-2-7680 --network=internal-vpc --no-assign-ip --require-ssl --enable-autoresizeAnswer
- Bgcloud sql instances create app-postgres-db --database-version=POSTGRES_15 --tier=db-custom-2-7680 --network=internal-vpc --require-ssl --enable-autoresize
- Cgcloud sql instances create app-postgres-db --database-version=POSTGRES_15 --tier=db-custom-2-7680 --network=internal-vpc --authorized-networks=10.0.0.0/16 --require-ssl --enable-autoresize
- Dgcloud sql instances create app-postgres-db --database-version=POSTGRES_15 --tier=db-custom-2-7680 --network=internal-vpc --disable-public-ip --ssl=required --enable-autoresize
Answer
The command starting with 'gcloud sql instances create app-postgres-db' that specifies '--no-assign-ip', '--network=internal-vpc', '--require-ssl', and '--enable-autoresize' correctly provisions the instance according to all security and operational requirements.
The option including '--no-assign-ip', '--network=internal-vpc', '--require-ssl', and '--enable-autoresize' fulfills all compliance criteria. Specifying '--network' attaches the instance to the private network, while '--no-assign-ip' ensures no public IPv4 address is assigned. Furthermore, '--require-ssl' forces encrypted incoming client connections and '--enable-autoresize' automatically expands storage capacity as data grows.
Step-by-Step Solution
Key Concept
Cloud SQL CLI Provisioning with Private IP, SSL Enforcement, and Auto-Resizing