Soru

Zorluk: OrtaDeploying and Configuring Managed Database Instances

A cloud engineer needs to configure Private Service Access within a custom Virtual Private Cloud (VPC) network named `corp-vpc` and provision a high-availability Cloud SQL for MySQL instance hosting an application database named `sales_db`. What is the correct sequence of `gcloud` CLI operations required to successfully complete this deployment?

  1. 1Run `gcloud compute addresses create` with `--purpose=VPC_PEERING` to allocate an internal IP range in `corp-vpc`.
  2. 2Run `gcloud services vpc-peerings connect` targeting `--service=servicenetworking.googleapis.com` to establish VPC peering.
  3. 3Run `gcloud sql instances create` with `--network=corp-vpc` and `--no-assign-ip` to deploy the private Cloud SQL instance.
  4. 4Run `gcloud sql databases create sales_db` specifying the newly created Cloud SQL instance name.

Cevap

The correct deployment sequence is: 1) Allocate an internal IP address range in the VPC network (`gcloud compute addresses create`), 2) Establish a VPC peering connection to Google services (`gcloud services vpc-peerings connect`), 3) Deploy the Cloud SQL instance configured with private IP (`gcloud sql instances create`), and 4) Create the logical database inside the provisioned instance (`gcloud sql databases create`).
Setting up a private Cloud SQL instance using Private Service Access requires four dependent steps in precise order: first, reserve a named IP address range inside the customer VPC network (`gcloud compute addresses create`); second, establish a peering connection between the VPC and `servicenetworking.googleapis.com` (`gcloud services vpc-peerings connect`); third, provision the Cloud SQL instance linked to that network while suppressing public IP (`gcloud sql instances create`); and finally, create the target database schema inside the active instance (`gcloud sql databases create`).

Adım Adım Çözüm

1
Allocate an IP range for VPC Peering
An IP range with purpose VPC_PEERING is reserved in corp-vpc.
Google Private Service Access requires an allocated IP range to assign private IP addresses to managed service instances.
2
Establish VPC Peering Connection
The VPC network is connected to Google's Service Networking tenant project.
Private Service Access uses VPC Peering between the customer VPC and Google's internal service network.
3
Provision the Cloud SQL Instance
The Cloud SQL instance is deployed without a public IP address.
The instance configuration references the peered VPC network and uses an IP address from the allocated range.
4
Create the Application Database
The sales_db database is initialized on the instance.
Database resources can only be created within an existing, fully provisioned Cloud SQL instance.

Anahtar Kavram

Sequence of steps for establishing Private Service Access and deploying private Cloud SQL instances
Bu soruyu puanla