An infrastructure team is setting up a production Cloud SQL PostgreSQL instance that must communicate exclusively via Private IP inside an existing custom Virtual Private Cloud network named `prod-vpc`. Arrange the following administrative commands and procedures in the correct sequential order to establish Private Service Access and deploy the database instance.
- 1Allocate an internal IP address range in `prod-vpc` reserved for service networking peering using `gcloud compute addresses create`.
- 2Establish a private connection between `prod-vpc` and Google services using `gcloud services peered-connections create`.
- 3Provision the Cloud SQL instance attached to `prod-vpc` with public IP disabled using `gcloud sql instances create --network=prod-vpc --no-assign-ip`.
- 4Create application database users on the database instance using `gcloud sql users create`.
Answer
The correct operational sequence is: 1) Allocate an internal IP range using gcloud compute addresses create, 2) Create the private service peering connection using gcloud services peered-connections create, 3) Create the Cloud SQL instance with gcloud sql instances create --network=prod-vpc --no-assign-ip, and 4) Provision database users using gcloud sql users create.
To deploy a Cloud SQL instance with Private IP connectivity, Google Cloud requires an established Private Service Access connection. The mandatory sequence begins with reserving an internal IP block (`gcloud compute addresses create`), followed by peering the VPC to Google managed services (`gcloud services peered-connections create`), then creating the instance attached to the VPC without a public IP (`gcloud sql instances create --network=prod-vpc --no-assign-ip`), and finally configuring database user credentials (`gcloud sql users create`).
Step-by-Step Solution
Key Concept
Sequential provisioning of GCP Private Service Access and Private IP Cloud SQL instances