
Answer-first summary for fast verification
Answer: roles/spanner.databaseUser
## Explanation **Correct Answer: A) roles/spanner.databaseUser** **Why this is correct:** 1. **Specificity**: The `roles/spanner.databaseUser` role is specifically designed for granting access to Cloud Spanner databases. It provides the necessary permissions to read and write data in Spanner databases. 2. **Principle of Least Privilege**: This role follows the security best practice of granting only the permissions needed for the specific task (accessing databases), rather than broader permissions. 3. **Google Cloud IAM Best Practices**: For database access, Google recommends using database-specific roles rather than general IAM roles. **Why other options are incorrect:** **B) roles/viewer** - This is a general IAM role that provides read-only access to view resources but doesn't grant database-specific permissions needed to read/write data in Cloud Spanner. **C) roles/owner** - This role provides full administrative control over all resources in a project, which is excessive and violates the principle of least privilege for database access. **D) roles/editor** - This role allows modifying resources but doesn't provide the specific database permissions needed for Cloud Spanner operations. **Key Takeaway**: When granting access to specific Google Cloud services like Cloud Spanner, always use service-specific roles (prefixed with the service name) rather than general IAM roles for better security and appropriate permission scoping.
Author: Rodrigo Sales
Ultimate access to all questions.
No comments yet.