- A
Add a condition in the key policy that allows decrypt only when the principal matches the desired IAM roles.
Conditions can restrict decryption to specific roles.
- B
Grant all IAM users decrypt permission and rely on S3 bucket policies.
Why wrong: This is insecure and not recommended.
- C
Create an IAM policy that grants kms:Decrypt only to the specific roles.
IAM policies can grant decrypt permissions to roles.
- D
Create a customer-managed customer master key (CMK) in KMS.
Customer-managed CMKs allow custom key policies.
- E
Use separate CMKs for each IAM role to isolate access.
Why wrong: This adds complexity without necessity; a condition can suffice.
Quick Answer
The correct answer is to create a customer-managed customer master key (CMK) in KMS, as this allows you to attach a resource-based key policy that directly controls access. By adding a condition to the key policy using the `aws:PrincipalArn` or `kms:CallerPrincipal` condition key, you can restrict the `kms:Decrypt` action to only specific IAM roles, ensuring that even if a user has broad IAM permissions, they cannot decrypt data unless their role is explicitly listed. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding that key policies are evaluated before IAM policies and can explicitly deny access, making them the most secure method for fine-grained control. A common trap is assuming IAM policies alone suffice, but remember: key policies act as the first gatekeeper. Memory tip: think of the key policy as a bouncer checking a VIP list (specific roles) before anyone can enter the decryption club.
DVA-C02 Security Practice Question
This DVA-C02 practice question tests your understanding of security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. 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 company uses AWS KMS to encrypt data in S3. The security team wants to ensure that only specific IAM roles can decrypt the data. Which THREE steps should be taken?
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
Add a condition in the key policy that allows decrypt only when the principal matches the desired IAM roles.
Option A is correct because key policies in AWS KMS are resource-based policies that directly control access to the CMK. By adding a condition that restricts the `kms:Decrypt` action to only specific IAM roles (using the `aws:PrincipalArn` or `kms:CallerPrincipal` condition key), the security team can ensure that only those roles can decrypt data encrypted with that key. This approach is more secure than relying solely on IAM policies, as key policies are evaluated first and can explicitly deny access even if an IAM policy grants it.
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.
- ✓
Add a condition in the key policy that allows decrypt only when the principal matches the desired IAM roles.
Why this is correct
Conditions can restrict decryption to specific roles.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Grant all IAM users decrypt permission and rely on S3 bucket policies.
Why it's wrong here
This is insecure and not recommended.
- ✓
Create an IAM policy that grants kms:Decrypt only to the specific roles.
Why this is correct
IAM policies can grant decrypt permissions to roles.
Related concept
Read the scenario before looking for a memorised answer.
- ✓
Create a customer-managed customer master key (CMK) in KMS.
Why this is correct
Customer-managed CMKs allow custom key policies.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Use separate CMKs for each IAM role to isolate access.
Why it's wrong here
This adds complexity without necessity; a condition can suffice.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often think IAM policies alone are sufficient for KMS access control, but they forget that KMS key policies are the primary mechanism and must explicitly allow IAM policies to take effect; otherwise, even if an IAM policy grants `kms:Decrypt`, the key policy will deny the request.
Detailed technical explanation
How to think about this question
Under the hood, AWS KMS evaluates key policies before IAM policies when determining access to a CMK. The `kms:Decrypt` permission is granted by the key policy, and IAM policies can only grant additional permissions if the key policy explicitly allows it (e.g., via a root principal). A common real-world scenario is using the `kms:ViaService` condition key to restrict decryption to requests originating from a specific AWS service, but here the requirement is role-specific, so `aws:PrincipalArn` is more appropriate. Additionally, the `kms:GrantIsForAWSAccount` condition can be used to prevent cross-account access.
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 media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
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.
- →
Security — study guide chapter
Learn the concepts, then practise the questions
- →
Security practice questions
Targeted practice on this topic area only
- →
All DVA-C02 questions
1,616 questions across all exam domains
- →
AWS Certified Developer Associate DVA-C02 study guide
Full concept coverage aligned to exam objectives
- →
DVA-C02 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related DVA-C02 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Development with AWS Services practice questions
Practise DVA-C02 questions linked to Development with AWS Services.
Security practice questions
Practise DVA-C02 questions linked to Security.
Deployment practice questions
Practise DVA-C02 questions linked to Deployment.
Troubleshooting and Optimization practice questions
Practise DVA-C02 questions linked to Troubleshooting and Optimization.
DVA-C02 fundamentals practice questions
Practise DVA-C02 questions linked to DVA-C02 fundamentals.
DVA-C02 scenario practice questions
Practise DVA-C02 questions linked to DVA-C02 scenario.
DVA-C02 troubleshooting practice questions
Practise DVA-C02 questions linked to DVA-C02 troubleshooting.
Practice this exam
Start a free DVA-C02 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 DVA-C02 question test?
Security — This question tests Security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Add a condition in the key policy that allows decrypt only when the principal matches the desired IAM roles. — Option A is correct because key policies in AWS KMS are resource-based policies that directly control access to the CMK. By adding a condition that restricts the `kms:Decrypt` action to only specific IAM roles (using the `aws:PrincipalArn` or `kms:CallerPrincipal` condition key), the security team can ensure that only those roles can decrypt data encrypted with that key. This approach is more secure than relying solely on IAM policies, as key policies are evaluated first and can explicitly deny access even if an IAM policy grants it.
What should I do if I get this DVA-C02 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 →
Same concept, more angles
1 more ways this is tested on DVA-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is using AWS KMS to encrypt data in S3. They want to ensure that only specific IAM roles can decrypt the data, even if the IAM role has full S3 access. What should they do?
hard- A.Use an IAM policy to deny KMS Decrypt for all users except the role.
- B.Add a bucket policy that denies Decrypt for all principals except the role.
- C.Enable S3 Block Public Access on the bucket.
- ✓ D.Modify the KMS key policy to grant decrypt permission only to the specific IAM role.
Why D: Option D is correct because a KMS key policy can grant decrypt permission to specific IAM roles. Option A is wrong because bucket policies only control S3 access, not KMS decrypt. Option B is wrong because IAM policies alone cannot restrict decrypt if the role has access. Option C is wrong because S3 Block Public Access does not affect KMS.
Last reviewed: Jun 24, 2026
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services 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 DVA-C02 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.