The answer is that the trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it. This is because IAM database authentication for RDS works by having the EC2 instance generate a temporary authentication token using its own role credentials, but the RDS resource-based policy explicitly requires the 'DatabaseAccessRole' to connect. Without a trust relationship that permits 'EC2-AppRole' to assume 'DatabaseAccessRole', the token generation request fails, as the EC2 instance cannot delegate its identity to the permitted role. On the DOP-C02 exam, this scenario tests your understanding of the two-step authentication flow: the instance role must be trusted to assume the database role, not just be allowed by the database policy. A common trap is confusing resource-based policies with trust policies—remember that the database policy specifies *who* can connect, while the trust policy specifies *how* they get the right to do so. Memory tip: “Trust before access—the role must be allowed to switch hats.”
DOP-C02 Incident and Event Response Practice Question
This DOP-C02 practice question tests your understanding of incident and event response. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. 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.
Exhibit
Refer to the exhibit.
Error log from an application instance:
2023-10-01T12:34:56Z ERROR Failed to assume role: AccessDenied
User: arn:aws:sts::123456789012:assumed-role/EC2-AppRole/i-0a1b2c3d4e5f
is not authorized to perform: sts:AssumeRole on resource:
arn:aws:iam::123456789012:role/DatabaseAccessRole
A DevOps engineer is troubleshooting an application running on an EC2 instance. The application needs to access an Amazon RDS database using IAM database authentication. The EC2 instance is associated with an IAM role 'EC2-AppRole', and the RDS instance has a resource-based policy that allows 'DatabaseAccessRole' to connect. The engineer sees the error in the exhibit. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Refer to the exhibit.
Error log from an application instance:
2023-10-01T12:34:56Z ERROR Failed to assume role: AccessDenied
User: arn:aws:sts::123456789012:assumed-role/EC2-AppRole/i-0a1b2c3d4e5f
is not authorized to perform: sts:AssumeRole on resource:
arn:aws:iam::123456789012:role/DatabaseAccessRole
A
The RDS instance does not have a resource-based policy that grants access to 'DatabaseAccessRole'.
Why wrong: B is wrong because the error is about assuming the role, not about the RDS policy.
B
The security group for the EC2 instance does not allow outbound traffic to the RDS instance.
Why wrong: D is wrong because the error is an IAM permission error, not a network connectivity error.
C
The EC2 instance does not have the correct IAM instance profile attached.
Why wrong: C is wrong because the log shows the instance role is assumed (the user ARN is from that role).
D
The trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it.
A is correct because the access denied error indicates the trust relationship is missing.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it.
The error indicates that the EC2 instance's IAM role 'EC2-AppRole' cannot authenticate to the RDS instance. IAM database authentication requires the EC2 instance to assume a database authentication token, which is generated by calling the RDS API with the 'EC2-AppRole' credentials. However, the RDS instance's resource-based policy only allows 'DatabaseAccessRole' to connect. For 'EC2-AppRole' to successfully authenticate, it must first assume 'DatabaseAccessRole' via a trust policy that permits the EC2 instance role to assume it. Without this trust relationship, the authentication token request fails, causing the error.
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.
✗
The RDS instance does not have a resource-based policy that grants access to 'DatabaseAccessRole'.
Why it's wrong here
B is wrong because the error is about assuming the role, not about the RDS policy.
✗
The security group for the EC2 instance does not allow outbound traffic to the RDS instance.
Why it's wrong here
D is wrong because the error is an IAM permission error, not a network connectivity error.
✗
The EC2 instance does not have the correct IAM instance profile attached.
Why it's wrong here
C is wrong because the log shows the instance role is assumed (the user ARN is from that role).
✓
The trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it.
Why this is correct
A is correct because the access denied error indicates the trust relationship is missing.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often assume the error is due to missing resource-based policies or network connectivity, but the core issue is the missing trust relationship between the EC2 instance role and the database access role, which is a common misconfiguration in cross-account or cross-role IAM authentication setups.
Trap categories for this question
Command / output trap
C is wrong because the log shows the instance role is assumed (the user ARN is from that role).
Detailed technical explanation
How to think about this question
IAM database authentication works by having the client (EC2 instance) call the RDS API's 'generate-db-auth-token' action using its own IAM credentials to obtain a temporary password. This token is then used to connect to the RDS database. For cross-role access, the EC2 role must have a trust policy allowing it to assume the database access role, and the database access role must have a permissions policy granting 'rds-db:connect' to the specific database user. Without the trust policy, the token generation fails with an 'AccessDenied' error because the EC2 role is not authorized to assume the database role.
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.
Incident and Event Response — This question tests Incident and Event Response — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The trust policy of the IAM role 'DatabaseAccessRole' does not allow the EC2 instance role 'EC2-AppRole' to assume it. — The error indicates that the EC2 instance's IAM role 'EC2-AppRole' cannot authenticate to the RDS instance. IAM database authentication requires the EC2 instance to assume a database authentication token, which is generated by calling the RDS API with the 'EC2-AppRole' credentials. However, the RDS instance's resource-based policy only allows 'DatabaseAccessRole' to connect. For 'EC2-AppRole' to successfully authenticate, it must first assume 'DatabaseAccessRole' via a trust policy that permits the EC2 instance role to assume it. Without this trust relationship, the authentication token request fails, causing the error.
What should I do if I get this DOP-C02 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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 →
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.
This DOP-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 DOP-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.