- A
Grant the Cloud Spanner service account the Editor role in the key project.
Why wrong: Editor is overly permissive and not recommended.
- B
Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key.
This role allows Spanner to use the key for encryption and decryption.
- C
Specify the key in the Spanner instance creation and provide the user's credentials for KMS access.
Why wrong: User credentials cannot be used by Spanner; service account is required.
- D
Grant the Spanner instance's service account the Cloud KMS Admin role on the key.
Why wrong: Admin role allows management of the key, not necessary.
Quick Answer
The correct answer is to grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key. This works because Cloud Spanner does not use your personal credentials to access the key; instead, it relies on its own Google-managed service account to perform encryption and decryption operations against Cloud KMS. When the key resides in a separate project, that service account must be explicitly authorized across project boundaries by assigning the Encrypter/Decrypter role at the key level, not the project level. On the Google Professional Cloud Database Engineer exam, this scenario tests your understanding of cross-project IAM delegation and the principle of least privilege—a common trap is granting broader roles like Cloud KMS Admin, which would violate security mandates. Remember the memory tip: “Spanner’s service account needs the key role, not your account.”
PCDE Plan and manage database infrastructure Practice Question
This PCDE practice question tests your understanding of plan and manage database infrastructure. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A financial institution requires all data stored in Cloud Spanner to be encrypted using customer-managed encryption keys (CMEK) stored in Cloud KMS. The security team mandates that the key be in a separate project from the Spanner instance. How should the database engineer configure this?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key.
Option B is correct because Cloud Spanner uses a service account to access Cloud KMS keys. To enable customer-managed encryption keys (CMEK) from a separate project, the Cloud Spanner service account must be granted the Cloud KMS CryptoKey Encrypter/Decrypter role on the specific key. This allows Spanner to encrypt and decrypt data using the key without granting broader permissions.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Grant the Cloud Spanner service account the Editor role in the key project.
Why it's wrong here
Editor is overly permissive and not recommended.
- ✓
Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key.
Why this is correct
This role allows Spanner to use the key for encryption and decryption.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Specify the key in the Spanner instance creation and provide the user's credentials for KMS access.
Why it's wrong here
User credentials cannot be used by Spanner; service account is required.
- ✗
Grant the Spanner instance's service account the Cloud KMS Admin role on the key.
Why it's wrong here
Admin role allows management of the key, not necessary.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse the Cloud KMS Admin role (which manages the key lifecycle) with the Encrypter/Decrypter role (which performs cryptographic operations), leading them to select option D instead of B.
Detailed technical explanation
How to think about this question
Under the hood, Cloud Spanner uses the Cloud KMS service to wrap and unwrap the data encryption keys (DEKs) using the customer-managed key (CMEK). The Spanner service account must have the 'cloudkms.cryptoKeyVersions.useToEncrypt' and 'cloudkms.cryptoKeyVersions.useToDecrypt' permissions, which are bundled in the Encrypter/Decrypter role. In a real-world scenario, if the key is rotated, Spanner automatically uses the latest version for encryption while still being able to decrypt data encrypted with older versions, as long as the service account retains the decrypter permission on those versions.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Plan and manage database infrastructure — study guide chapter
Learn the concepts, then practise the questions
- →
Plan and manage database infrastructure practice questions
Targeted practice on this topic area only
- →
All PCDE questions
503 questions across all exam domains
- →
Google Professional Cloud Database Engineer study guide
Full concept coverage aligned to exam objectives
- →
PCDE practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PCDE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Plan and manage database infrastructure practice questions
Practise PCDE questions linked to Plan and manage database infrastructure.
Define data structures and implement SQL for Business Intelligence practice questions
Practise PCDE questions linked to Define data structures and implement SQL for Business Intelligence.
Design and implement database schemas practice questions
Practise PCDE questions linked to Design and implement database schemas.
Monitor and optimize database performance practice questions
Practise PCDE questions linked to Monitor and optimize database performance.
PCDE fundamentals practice questions
Practise PCDE questions linked to PCDE fundamentals.
PCDE scenario practice questions
Practise PCDE questions linked to PCDE scenario.
PCDE troubleshooting practice questions
Practise PCDE questions linked to PCDE troubleshooting.
Practice this exam
Start a free PCDE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PCDE question test?
Plan and manage database infrastructure — This question tests Plan and manage database infrastructure — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key. — Option B is correct because Cloud Spanner uses a service account to access Cloud KMS keys. To enable customer-managed encryption keys (CMEK) from a separate project, the Cloud Spanner service account must be granted the Cloud KMS CryptoKey Encrypter/Decrypter role on the specific key. This allows Spanner to encrypt and decrypt data using the key without granting broader permissions.
What should I do if I get this PCDE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 25, 2026
This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.