Soru

Zorluk: OrtaDeploying and Configuring Managed Database Instances

A cloud engineer is deploying a new Cloud SQL for PostgreSQL instance named `analytics-db` for an internal reporting application. The compliance policy requires automated daily backups starting at 02:00 UTC and point-in-time recovery (PITR) enabled. Additionally, to ensure network security for public IP access, the instance must accept incoming connections strictly from an on-premises office CIDR block (`198.51.100.45/32`). Which `gcloud` command should the engineer run to provision this database instance correctly?

  1. gcloud sql instances create analytics-db --database-version=POSTGRES_15 --backup-start-time=02:00 --enable-point-in-time-recovery --authorized-networks=198.51.100.45/32Cevap
  2. B
    gcloud sql instances create analytics-db --database-version=POSTGRES_15 --backup-start-time=02:00 --enable-point-in-time-recovery --authorized-networks=0.0.0.0/0
  3. C
    gcloud compute instances create analytics-db --database-version=POSTGRES_15 --backup-start-time=02:00 --enable-pitr --authorized-networks=198.51.100.45/32
  4. D
    gcloud sql instances create analytics-db --database-version=POSTGRES_15 --enable-bin-log --backup-start-time=02:00 --authorized-networks=198.51.100.45/32

Cevap

Execute 'gcloud sql instances create analytics-db --database-version=POSTGRES_15 --backup-start-time=02:00 --enable-point-in-time-recovery --authorized-networks=198.51.100.45/32'.
The command 'gcloud sql instances create analytics-db --database-version=POSTGRES_15 --backup-start-time=02:00 --enable-point-in-time-recovery --authorized-networks=198.51.100.45/32' correctly provisions a Cloud SQL PostgreSQL instance, schedules daily automated backups starting at 02:00 UTC, enables PostgreSQL point-in-time recovery (PITR) via Write-Ahead Logs, and restricts incoming public connections exclusively to the specified on-premises CIDR block.

Adım Adım Çözüm

1
Identify the target resource service and CLI group
Use 'gcloud sql instances create' to manage Cloud SQL database instance deployments.
Compute Engine VM commands ('gcloud compute instances') do not provision managed database services.
2
Configure PostgreSQL point-in-time recovery and backup parameters
Include '--enable-point-in-time-recovery' and '--backup-start-time=02:00'.
Cloud SQL for PostgreSQL uses '--enable-point-in-time-recovery' to retain Write-Ahead Logs (WAL) for PITR, whereas '--enable-bin-log' applies only to MySQL.
3
Restrict public network exposure using authorized networks
Set '--authorized-networks=198.51.100.45/32'.
Restricts incoming connections to the specific corporate CIDR block rather than allowing unrestricted public access ('0.0.0.0/0').

Anahtar Kavram

Provisioning Cloud SQL instances with backup windows, PostgreSQL point-in-time recovery, and authorized networks using gcloud CLI.
Bu soruyu puanla