Google Cloud Associate Cloud Engineer — Question 22
You need to grant access for three users so that they can view and edit table data on a Cloud Spanner instance. What should you do?
Answer options
- A. Run gcloud iam roles describe roles/spanner.databaseUser. Add the users to the role.
- B. Run gcloud iam roles describe roles/spanner.databaseUser. Add the users to a new group. Add the group to the role.
- C. Run gcloud iam roles describe roles/spanner.viewer - -project my-project. Add the users to the role.
- D. Run gcloud iam roles describe roles/spanner.viewer - -project my-project. Add the users to a new group. Add the group to the role.
Correct answer: B
Explanation
Option B is correct because it allows the users to be added to a group, which can then be assigned to the spanner.databaseUser role, enabling them to view and edit data. Options A and C do not involve groups, which can be beneficial for managing multiple users. Option D incorrectly uses the viewer role, which does not provide the necessary edit permissions.