Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Database Engineer practice bank has an additional 769 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization stores transactional data across Cloud Spanner and Cloud SQL for PostgreSQL. Currently, an analyst Cloud Identity group holds roles/spanner.databaseUser on the Spanner database, and you must redesign access to enforce least privilege:
SELECT access on only the orders table.SELECT privileges from the group while authenticating with their individual IAM identities for auditability.Which IAM and database RBAC configuration should you implement?
This configuration defines a Cloud Spanner database role and enables IAM group authentication on Cloud SQL, but omits the IAM Condition on roles/spanner.databaseRoleUser, leaves roles/spanner.databaseUser active, and substitutes roles/cloudsql.viewer for roles/cloudsql.instanceUser.
roles/spanner.databaseRoleUser without an IAM Condition grants the principal permission to assume all database roles in the Spanner database—including privileged roles—directly violating least privilege.roles/spanner.databaseUser leaves the group with broad read and write permissions across the entire database, bypassing the orders table restriction.roles/cloudsql.client allows network connectivity to the instance, roles/cloudsql.viewer only grants read-only access to instance metadata and does not include the cloudsql.instances.login permission required to authenticate to PostgreSQL via IAM.roles/spanner.databaseRoleUser must be paired with a condition targeting spanner.googleapis.com/DatabaseRole to limit access to specific roles.roles/spanner.databaseUser should be revoked once FGAC roles are configured.roles/cloudsql.viewer inspects Cloud SQL instance properties in the console or API, whereas roles/cloudsql.instanceUser enables database login.You intentionally wanted a principal to access every database role in a Spanner database (with roles/spanner.databaseUser still removed) and only needed to view Cloud SQL instance details rather than log into PostgreSQL with IAM credentials.
Omitting the IAM Condition when assigning roles/spanner.databaseRoleUser is a common misconfiguration that silently exposes all custom and system database roles to the bound group.
Combining Identity and Access Management (IAM) with database-level role-based access control (RBAC) bridges cloud identity governance and granular SQL permissions. IAM controls who can connect to and assume roles on a managed database resource, while native database roles enforce the principle of least privilege at the schema, table, and operation levels.
CREATE ROLE) and issuing GRANT SELECT ON TABLE orders TO ROLE ... restricts query permissions exclusively to SELECT on the orders table.roles/spanner.fineGrainedAccessUser enables fine-grained access control (FGAC) for the group, while binding roles/spanner.databaseRoleUser with an IAM Condition (resource.type == "spanner.googleapis.com/DatabaseRole" && resource.name.endsWith("/ROLE")) ensures the group can assume only that specific database role.roles/spanner.databaseUser removes broad database-level permissions so that access is governed strictly by the fine-grained database role.roles/cloudsql.client allows the group's members to connect to the Cloud SQL instance, and roles/cloudsql.instanceUser supplies the cloudsql.instances.login permission needed for IAM authentication.SELECT privileges are granted once to the Cloud Identity group in PostgreSQL, while each analyst authenticates using their own IAM credentials and temporary access token.Unlike solutions that leave broad database-level IAM roles intact, omit IAM Conditions, or rely on shared passwords, this approach cleanly maps IAM identities to least-privilege SQL permissions across both Spanner and Cloud SQL for PostgreSQL.
This option attempts to use an IAM Condition on roles/spanner.databaseUser to restrict access to a single Spanner table, and implements individual IAM database authentication rather than group-based RBAC on Cloud SQL for PostgreSQL.
orders. IAM Conditions for Spanner fine-grained access control apply to spanner.googleapis.com/DatabaseRole resources alongside roles/spanner.databaseRoleUser. Additionally, roles/spanner.databaseUser grants full read and write privileges across the database rather than SELECT-only access.SELECT grants, failing the requirement for analysts to inherit privileges from the Cloud Identity group.GRANT statements enforce table- and column-level permissions.roles/spanner.databaseUser permits INSERT, UPDATE, and DELETE operations in addition to SELECT.You needed to grant a single service account full read/write permissions across an entire Spanner database and preferred managing a small, static set of isolated user accounts directly in Cloud SQL without group inheritance.
A common misconception is that IAM Conditions can enforce SQL table-level boundaries directly; in practice, IAM must delegate fine-grained object authorization to Spanner database roles.
This option combines roles/spanner.databaseReader with roles/spanner.fineGrainedAccessUser in Cloud Spanner, while assigning roles/cloudsql.editor and a shared built-in database authentication account in Cloud SQL for PostgreSQL.
roles/spanner.databaseReader is a database-level IAM role that grants read permissions across every table in the Spanner database rather than limiting reads to orders. Furthermore, without roles/spanner.databaseRoleUser and an IAM Condition (and without revoking roles/spanner.databaseUser), the group is not properly restricted to the created database role.roles/cloudsql.editor provides broad instance-management permissions—such as modifying instance settings and triggering exports (cloudsql.instances.export)—violating least privilege for read-only analysts.roles/spanner.databaseReader apply uniformly to all tables and views in a Spanner database.Analysts required unrestricted read access across all tables in a Spanner database, needed permissions to manage Cloud SQL instances, and the application relied on legacy shared password authentication without per-user auditing.
With IAM group authentication in Cloud SQL, permissions are managed at the group level, yet each member logs in with their own IAM account so individual activity remains visible in audit logs.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated