Question

Difficulty: EasyProvisioning Storage and Database Systems

A cloud operations team needs to deploy a new PostgreSQL database on Google Cloud using Cloud SQL and populate it using a local database dump file. What is the correct sequence of steps to provision the storage staging environment, transfer the dump, and populate the database?

  1. 1Create a Cloud Storage bucket to serve as the staging location for the database dump file.
  2. 2Upload the local database dump file into the newly created Cloud Storage bucket.
  3. 3Provision the Cloud SQL database instance with the PostgreSQL database engine.
  4. 4Grant the Cloud SQL instance service account storage reader permissions on the bucket and run the database import operation.

Answer

The correct sequence begins by creating a Cloud Storage staging bucket, uploading the local database dump file to the bucket, provisioning the Cloud SQL instance, and finally granting IAM permissions to the Cloud SQL service account to execute the import job.
Provisioning database resources on Google Cloud when starting from a local dump requires a staging location. First, a Cloud Storage bucket is created to host the dump file. Second, the dump file is uploaded from the local environment into the bucket. Third, the Cloud SQL database instance is provisioned. Finally, the service account assigned to the Cloud SQL instance is granted permissions on the Cloud Storage bucket so the import operation can execute successfully.

Step-by-Step Solution

1
Create the staging storage bucket
A Cloud Storage bucket is available to receive object uploads.
Cloud SQL import operations require data to be hosted in Cloud Storage.
2
Upload the database dump file to Cloud Storage
The file is stored in Google Cloud and ready for Cloud SQL access.
Local files cannot be imported directly into Cloud SQL without first residing in a staging bucket.
3
Provision the Cloud SQL database instance
The database server is instantiated and running.
Target infrastructure must exist to accept the imported data schema and records.
4
Authorize the service account and run the import job
The database instance is populated with the staging data.
Cloud SQL uses its service account to read from Cloud Storage, requiring explicit IAM access prior to running the import.

Key Concept

Provisioning Cloud SQL and Cloud Storage staging pipelines
Rate this question