nerdexam
AmazonAmazon

DOP-C02 · Question #485

DOP-C02 Question #485: Real Exam Question with Answer & Explanation

The correct answer is A: Create a CloudWatch metric based on the application logs. Create a CloudWatch alarm based on. Explanation Option A is correct because creating a CloudWatch metric filter based on application logs, then configuring a CloudWatch alarm tied to that metric, allows the alarm to automatically trigger a CodeDeploy rollback action when error thresholds are breached - this is the

Submitted by ahmad_uae· Mar 6, 2026Monitoring and Logging

Question

A company uses AWS CodePipeline and AWS CodeDeploy to deploy application code to Amazon EC2 instances. The EC2 instances send application logs and CodeDeploy logs to Amazon CloudWatch. Recently, the company manually rolled back a deployment because of application errors. The company wants to automate the rollback process when application errors occur. Which solution will meet these requirements?

Options

  • ACreate a CloudWatch metric based on the application logs. Create a CloudWatch alarm based on
  • BConfigure a CloudWatch alarm that uses a custom metric for application errors that are recorded
  • CCreate an AWS Lambda function that will create a new deployment by using the last successful
  • DCreate an AWS Lambda function that will create a new deployment group for the application

Explanation

Explanation

Option A is correct because creating a CloudWatch metric filter based on application logs, then configuring a CloudWatch alarm tied to that metric, allows the alarm to automatically trigger a CodeDeploy rollback action when error thresholds are breached - this is the native, fully integrated AWS approach that requires no custom code to orchestrate the rollback itself.

Why the distractors are wrong:

  • Option B is incomplete as described - while a CloudWatch alarm with a custom metric can detect errors, it doesn't specify the CodeDeploy integration needed to trigger the automated rollback, making it an insufficient standalone solution.
  • Option C is overly complex and fragile; writing a Lambda function to manually create a new deployment using the last successful revision duplicates functionality that CodeDeploy's built-in automatic rollback already handles natively.
  • Option D is incorrect because creating a new deployment group is unnecessary and architecturally wrong - you don't need a new group to perform a rollback; you simply need to redeploy the previous revision within the existing group.

Memory Tip: Think "Alarm → Rollback" - CodeDeploy has a native setting to roll back when a CloudWatch alarm triggers, so always prefer the built-in integration over custom Lambda workarounds. When AWS services have native integrations, they're almost always the correct exam answer over custom code solutions.

Topics

#CloudWatch#CodeDeploy#Automated Rollback#Monitoring

Community Discussion

No community discussion yet for this question.

Full DOP-C02 PracticeBrowse All DOP-C02 Questions