A cloud engineer is deploying a Cloud SQL for PostgreSQL instance named 'orders-db' in a custom VPC network named 'production-vpc'. To meet security and operational compliance, the database instance must accept traffic exclusively via Private IP, enforce SSL/TLS encryption for all incoming client connections, and automatically increase storage capacity when available disk space is low. Which gcloud command correctly provisions this managed database instance?
- gcloud sql instances create orders-db --database-version=POSTGRES_15 --network=production-vpc --no-assign-ip --ssl-mode=ENCRYPTED_ONLY --enable-auto-increaseAnswer
- Bgcloud sql instances create orders-db --database-version=POSTGRES_15 --assign-ip --authorized-networks=0.0.0.0/0 --ssl-mode=ENCRYPTED_ONLY --enable-auto-increase
- Cgcloud sql instances create orders-db --database-version=POSTGRES_15 --network=production-vpc --no-assign-ip --require-ssl --auto-increase-storage
- Dgcloud compute instances create orders-db-vm --zone=us-central1-a --machine-type=e2-standard-4 --image-family=debian-11
Answer
The command 'gcloud sql instances create orders-db --database-version=POSTGRES_15 --network=production-vpc --no-assign-ip --ssl-mode=ENCRYPTED_ONLY --enable-auto-increase' correctly satisfies all requirements.
The correct choice utilizes valid gcloud CLI flags for Cloud SQL deployment: '--no-assign-ip' removes public IP exposure, '--network=production-vpc' attaches the instance to Private Service Access, '--ssl-mode=ENCRYPTED_ONLY' requires SSL/TLS client connections, and '--enable-auto-increase' turns on automatic disk size expansion.
Step-by-Step Solution
Key Concept
Deploying Cloud SQL instances with Private IP, SSL enforcement, and storage auto-increase via gcloud CLI