A Cloud Engineer needs to import data into a Cloud SQL for MySQL instance from a SQL dump file stored in a Google Cloud Storage bucket using the gcloud command-line interface. Which sequence of steps represents the correct procedure to execute this operation successfully?
- 1Identify the service account email address assigned to the Cloud SQL instance using gcloud sql instances describe.
- 2Grant the Storage Object Viewer role (roles/storage.objectViewer) to the Cloud SQL service account on the GCS bucket containing the SQL dump file.
- 3Execute the gcloud sql import sql command referencing the target Cloud SQL instance and the GCS URI of the dump file.
- 4Monitor the import operation using gcloud sql operations list to verify successful completion.
Cevap
The correct operational sequence begins by retrieving the Cloud SQL instance service account identity, granting that service account the Storage Object Viewer IAM role on the GCS bucket, running the gcloud sql import sql command, and finally verifying the asynchronous operation status.
To import data into Cloud SQL from Cloud Storage, the Cloud SQL instance's managed service account must first be retrieved and granted read permissions on the bucket. Only after IAM permissions are in place can the gcloud sql import sql command succeed, followed by checking operation status for completion.
Adım Adım Çözüm
Anahtar Kavram
Cloud SQL Data Import Procedures and IAM Authorization