Course menuDVA-C03

Exams / DVA-C03 / Custom metrics, alarms and health checks / Question 4

DVA-C03 practice question: Custom metrics, alarms and health checks (4 of 4)

Troubleshooting and Optimization A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A platform team deploys its services with AWS CodeDeploy. The on-call channel must hear about every deployment that finishes, whether it succeeds or fails, within a minute of the change.

The team does not want to change its deployment scripts or run a polling job that calls the CodeDeploy API every minute. The alerts go to an Amazon SNS topic that already posts to the channel.

Which solution meets these requirements?

Choose one answer.

  1. A. Add a step to each deployment script that publishes to the SNS topic when the script exits, with the result of the script.
  2. B. Run an AWS Lambda function every minute that calls the CodeDeploy API for recent deployments, and publishes any new success or failure to the SNS topic.
  3. C. Create an Amazon EventBridge rule that matches CodeDeploy deployment state-change events with the SUCCESS and FAILURE states, with the SNS topic as the target.
  4. D. Turn on CloudWatch Logs for the CodeDeploy agent on each instance, and create a metric filter that publishes to the SNS topic when a line contains the word Deployment.
Show the answer and explanation

Answer: C

  • A. Wrong: This changes every deployment script, which the team wants to avoid. It also misses deployments that fail outside the script, such as during an agent step.
  • B. Wrong: This is the polling job the team ruled out. It also adds a function and a schedule that the team must maintain.
  • C. Right: Correct. CodeDeploy sends deployment state-change events to EventBridge, and a rule can match the SUCCESS and FAILURE states and send each event to the SNS topic. No script changes or polling are needed. Learn more: Monitoring deployments with Amazon CloudWatch Events (opens in a new tab)
  • D. Wrong: Agent logs live on the instances and do not cover every deployment, such as ones that fail before reaching an instance. A text match on a log line is also a fragile signal for success or failure.

Explanation

CodeDeploy publishes deployment state-change events to Amazon EventBridge. A rule that matches the SUCCESS and FAILURE states and targets the SNS topic alerts the channel about each finished deployment, with no change to the scripts and no polling.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Custom metrics, alarms and health checks? The 5 full-length practice sets have 16 more Custom metrics, alarms and health checks questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets