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.
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.
AA. Add a step to each deployment script that publishes to the SNS topic when the script exits, with the result of the script.
BB. 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.
CC. 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.
DD. 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.
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.
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 →