QuestionQ105

VerifiedDeploy scalable and highly available databases in Google Cloud

An analytics team must read data from Cloud SQL for SQL Server and update a table in Cloud Spanner. You need to create a service account and grant least-privilege access by using predefined roles. Which roles should you assign to the service account?

Explanation

Both viable options include roles/spanner.databaseUser, which grants read AND write (DML) on the Spanner database and is required to update the table; spanner.databaseReader (C) is read-only and spanner.admin (B) exceeds least privilege. For the Cloud SQL side, roles/cloudsql.instanceUser grants the ability to log in to and access the instance so data can be read, whereas roles/cloudsql.viewer (A) only exposes instance metadata and grants no access to the data itself. So D (instanceUser + databaseUser) is the least-privilege pair that actually lets the service account read Cloud SQL data and update the Spanner table.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!