Soru

Zorluk: OrtaDeploying and Configuring Managed Database Instances

A cloud engineer needs to deploy a Cloud SQL for PostgreSQL database instance that is accessible exclusively using Private IP within an existing VPC network named `prod-vpc`. Arrange the operational steps in the correct sequential order to establish Private Service Access and provision the database instance.

  1. 1Allocate an internal IP address range in the `prod-vpc` network for Google private services usage.
  2. 2Establish a private connection between `prod-vpc` and the `servicenetworking.googleapis.com` service producer.
  3. 3Provision the Cloud SQL instance specifying `prod-vpc` for network connectivity and disabling public IP assignment.
  4. 4Create the database user and initial database schema within the newly provisioned Cloud SQL instance.

Cevap

The correct operational sequence is: First, allocate an internal IP address range in the VPC network for private services. Second, establish a private connection (VPC peering) to the service producer. Third, provision the Cloud SQL instance with private IP enabled and public IP disabled. Fourth, create the initial database and configure database users.
To set up Cloud SQL with Private IP, you must first allocate an internal IP range in your VPC network. Next, you establish a VPC peering connection to `servicenetworking.googleapis.com` using that reserved range. Once private connectivity is established, you can create the Cloud SQL instance associated with the VPC network without assigning a public IP. Finally, you create the application database and user accounts inside the instance.

Adım Adım Çözüm

1
Allocate internal IP address range in the VPC
Reserved IP range is available for private service allocation.
Private Service Access requires a dedicated internal IP address block in the host VPC network before connecting.
2
Create VPC peering with Service Networking API
Peering connection is established between the host VPC and Google's tenant VPC.
Cloud SQL Private IP relies on VPC Network Peering managed by the Service Networking API to connect the customer network to Google service infrastructure.
3
Provision Cloud SQL instance using `--network` and `--no-assign-ip`
Cloud SQL instance is deployed with an internal IP address within the peered range.
The database instance creation depends on the underlying private service connection already being established.
4
Create database user and application database
Database application environment is ready for application connections.
Administrative database user credentials and databases can only be configured once the instance is active.

Anahtar Kavram

Configuring Private Service Access for Cloud SQL Private IP connectivity
Bu soruyu puanla