Soru

Zorluk: OrtaManaging Storage and Database Solutions

An operations engineer needs to export a production database from a Cloud SQL for MySQL instance to a Google Cloud Storage bucket using the gcloud CLI. The process must follow Google Cloud security best practices by granting the minimum required service account permissions. What is the correct sequence of steps to perform this export operation successfully?

  1. 1Retrieve the auto-generated service account address associated with the Cloud SQL instance using `gcloud sql instances describe`.
  2. 2Grant the Cloud SQL service account the `roles/storage.objectAdmin` role on the target Cloud Storage bucket.
  3. 3Execute the `gcloud sql export sql` command, specifying the instance name and the target `gs://` bucket URI.
  4. 4Verify the operational status of the export task using `gcloud sql operations list` and confirm the file presence in Cloud Storage.

Cevap

The correct operational sequence begins by retrieving the service account email of the Cloud SQL instance, granting that service account the Storage Object Admin role on the Cloud Storage destination bucket, running the gcloud sql export command, and finally verifying the completed operation status and bucket contents.
Exporting data from Cloud SQL to Cloud Storage requires proper delegation of authority. First, you must identify the Cloud SQL service account associated with the instance. Second, that service account must be granted write access (roles/storage.objectAdmin) on the destination Cloud Storage bucket. Third, you execute the gcloud sql export sql command. Fourth, you inspect the operation completion status to confirm successful export.

Adım Adım Çözüm

1
Retrieve Cloud SQL Instance Identity
Obtained service account email (serviceAccountEmail field).
Cloud SQL uses its own service account to write data to Cloud Storage.
2
Configure IAM Access Control
Service account is authorized to create objects in the destination bucket.
Without explicit Object Admin/Creator access on the bucket, export operations fail with permission denied errors.
3
Initiate Export Command
Cloud SQL starts streaming the SQL dump to the Cloud Storage URI.
The export command relies on pre-configured permissions to run asynchronously.
4
Monitor and Validate Operation
Confirmed successful operation status and verified SQL file creation.
Operational auditing validates that database backups completed cleanly.

Anahtar Kavram

Cloud SQL Database Export Procedures and IAM Service Account Authorization
Bu soruyu puanla