The answer is D: the function needs to specify a metric name and value when calling PutMetricData. While the IAM policy correctly grants `cloudwatch:PutMetricData` on resource `"*"`—which is the only allowed resource for this action since CloudWatch custom metrics do not support resource-level permissions—the Lambda function’s code must still provide the required parameters, including a metric name, value, and namespace, in the API call. Without these, the PutMetricData request fails silently, and no custom metrics appear. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this question tests your ability to distinguish between IAM permission issues and API call syntax errors; a common trap is assuming a permissive policy guarantees successful metric publication. Remember: PutMetricData requires `"*"` as the resource, but the function must also supply the metric name and value—think "policy opens the door, but the code must walk through it."
DOP-C02 Monitoring and Logging Practice Question
This DOP-C02 practice question tests your understanding of monitoring and logging. 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.
Refer to the exhibit. The IAM policy above is attached to a Lambda function's execution role. The Lambda function is supposed to publish custom metrics to CloudWatch using PutMetricData. However, the metrics are not appearing. What is the most likely reason?
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.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The function needs to specify a metric name and value when calling PutMetricData.
Option B is correct because the policy allows cloudwatch:PutMetricData on resource "*", which is sufficient to publish custom metrics. However, the issue could be that the Lambda function does not have the necessary permissions to create the metric namespace or that the function is not calling the API correctly. But among the options, the most plausible is that the function might be using a different action or missing permissions, but the policy shown seems correct. Actually, the correct answer is that the policy is missing the 'cloudwatch:PutMetricData' action? No, it has it. Let's analyze: The policy allows PutMetricData, so that is not the issue. Option A is wrong because it does have the action. Option C is wrong because wildcard resource is allowed for PutMetricData. Option D is wrong because the function can call PutMetricData without specifying a metric. So perhaps the issue is that the function is not running or the code is incorrect. However, the question asks the most likely reason given the exhibit. The exhibit shows a permissive policy, so the function should be able to publish metrics. Therefore, the problem is likely outside the scope of the policy, such as the function not executing or an error in the code. But among the options, Option B is the only one that points to a missing permission? Actually, the policy includes PutMetricData, so Option B is incorrect. Let me re-read: Option B says 'The policy does not include the 'cloudwatch:PutMetricData' action.' But it does! So that is false. Option A says 'The policy includes unnecessary actions.' That would not prevent metrics from appearing. Option C says 'The policy uses a wildcard resource.' That is not a problem. Option D says 'The function needs to specify a metric name and value.' That is true but not a policy issue. Since the question is about the IAM policy, the most likely reason is that the policy is missing a required action? But it has PutMetricData. So maybe the correct answer is that the function is not calling the API correctly. But the options are limited. Perhaps I misread: The exhibit shows the policy, and the answer might be that the resource should not be '*' but specific. However, PutMetricData does not support resource-level permissions; it must be '*'. So Option C is actually correct in that the wildcard is required. So the policy is correct. Then the issue is likely that the function is not invoking the API. But the question asks for the most likely reason based on the exhibit. Given the exhibit, the policy is correct, so the issue must be elsewhere. Option D says 'The function needs to specify a metric name and value.' That is a requirement of the API call, not the policy. So the most likely reason from the options could be that the function is missing the metric specification. But that is not a policy issue. I think the intended answer might be that the policy does not include the necessary permissions, but it does. Let me check the options again: A) The policy includes unnecessary actions. B) The policy does not include the 'cloudwatch:PutMetricData' action. (But it does) C) The policy uses a wildcard resource, which is not allowed for PutMetricData. (Actually, PutMetricData requires resource '*', so this is false) D) The function needs to specify a metric name and value. This is true but not a policy issue. Since the question is about why metrics are not appearing, and the policy seems correct, the most likely reason is that the function code is incorrect. However, the exam expects that PutMetricData requires a resource of '*', so the policy is correct. So the answer might be that the policy is fine, and the function is misconfigured. But none of the options say that. Option D is the closest to a functional issue. Given the constraints, I'll go with D. But to align with typical DOP-C02 questions, the correct answer is often that the policy needs specific actions. Since the policy has PutMetricData, maybe the issue is that the function is not using the correct namespace or metric name, but that is not listed. I'll choose D.
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 policy does not include the 'cloudwatch:PutMetricData' action.
Why it's wrong here
The policy clearly includes cloudwatch:PutMetricData.
✗
The policy includes unnecessary actions that conflict with each other.
Why it's wrong here
There is no conflict; the actions are compatible.
✓
The function needs to specify a metric name and value when calling PutMetricData.
Why this is correct
Even with the correct permissions, the function must include the metric name and value in the API call; otherwise, no metric is published.
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.
✗
The policy uses a wildcard resource, which is not allowed for the PutMetricData action.
Why it's wrong here
PutMetricData must use a wildcard resource '*'; it is allowed.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.
Detailed technical explanation
How to think about this question
This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.
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.
Use explanations to understand the rule behind the answer.
TExam Day Tips
→Underline the problem statement mentally.
→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 DOP-C02 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.
Monitoring and Logging — This question tests Monitoring and Logging — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The function needs to specify a metric name and value when calling PutMetricData. — Option B is correct because the policy allows cloudwatch:PutMetricData on resource "*", which is sufficient to publish custom metrics. However, the issue could be that the Lambda function does not have the necessary permissions to create the metric namespace or that the function is not calling the API correctly. But among the options, the most plausible is that the function might be using a different action or missing permissions, but the policy shown seems correct. Actually, the correct answer is that the policy is missing the 'cloudwatch:PutMetricData' action? No, it has it. Let's analyze: The policy allows PutMetricData, so that is not the issue. Option A is wrong because it does have the action. Option C is wrong because wildcard resource is allowed for PutMetricData. Option D is wrong because the function can call PutMetricData without specifying a metric. So perhaps the issue is that the function is not running or the code is incorrect. However, the question asks the most likely reason given the exhibit. The exhibit shows a permissive policy, so the function should be able to publish metrics. Therefore, the problem is likely outside the scope of the policy, such as the function not executing or an error in the code. But among the options, Option B is the only one that points to a missing permission? Actually, the policy includes PutMetricData, so Option B is incorrect. Let me re-read: Option B says 'The policy does not include the 'cloudwatch:PutMetricData' action.' But it does! So that is false. Option A says 'The policy includes unnecessary actions.' That would not prevent metrics from appearing. Option C says 'The policy uses a wildcard resource.' That is not a problem. Option D says 'The function needs to specify a metric name and value.' That is true but not a policy issue. Since the question is about the IAM policy, the most likely reason is that the policy is missing a required action? But it has PutMetricData. So maybe the correct answer is that the function is not calling the API correctly. But the options are limited. Perhaps I misread: The exhibit shows the policy, and the answer might be that the resource should not be '*' but specific. However, PutMetricData does not support resource-level permissions; it must be '*'. So Option C is actually correct in that the wildcard is required. So the policy is correct. Then the issue is likely that the function is not invoking the API. But the question asks for the most likely reason based on the exhibit. Given the exhibit, the policy is correct, so the issue must be elsewhere. Option D says 'The function needs to specify a metric name and value.' That is a requirement of the API call, not the policy. So the most likely reason from the options could be that the function is missing the metric specification. But that is not a policy issue. I think the intended answer might be that the policy does not include the necessary permissions, but it does. Let me check the options again: A) The policy includes unnecessary actions. B) The policy does not include the 'cloudwatch:PutMetricData' action. (But it does) C) The policy uses a wildcard resource, which is not allowed for PutMetricData. (Actually, PutMetricData requires resource '*', so this is false) D) The function needs to specify a metric name and value. This is true but not a policy issue. Since the question is about why metrics are not appearing, and the policy seems correct, the most likely reason is that the function code is incorrect. However, the exam expects that PutMetricData requires a resource of '*', so the policy is correct. So the answer might be that the policy is fine, and the function is misconfigured. But none of the options say that. Option D is the closest to a functional issue. Given the constraints, I'll go with D. But to align with typical DOP-C02 questions, the correct answer is often that the policy needs specific actions. Since the policy has PutMetricData, maybe the issue is that the function is not using the correct namespace or metric name, but that is not listed. I'll choose D.
What should I do if I get this DOP-C02 question wrong?
Identify which DOP-C02 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.
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.