Q84 — AWS DVA-C02 Ch.3
Question 84 of 100 | ← Chapter 3
A company is deploying a new application on AWS. The company is streaming application logs to Amazon CloudWatch Logs. The development team must receive email notifications whenever the term 'ERROR' appears in any log line. A developer has created an Amazon Simple Notification Service (Amazon SNS) topic and subscribed the development team to that topic. What action should the developer take next to meet this requirement?
- A. Select the appropriate log group. Create a CloudWatch metric filter with 'ERROR' as the search pattern. Create an alarm on this metric and configure it to notify the SNS topic when the metric value is 1 or higher. ✓
- B. In CloudWatch Logs Insights, select the appropriate log group. Create a metric query searching for the term 'ERROR' in logs. Create an alarm on this metric and configure it to notify the SNS topic when the metric value is 1 or higher.
- C. Select the appropriate log group. Create an SNS subscription filter with 'ERROR' as the filter pattern. Select the SNS topic as the destination.
- D. Create a CloudWatch alarm with 'ERROR' as the filter pattern, define the appropriate log group dimension, and specify the SNS topic as the target.
Correct Answer: A. Select the appropriate log group. Create a CloudWatch metric filter with 'ERROR' as the search pattern. Create an alarm on this metric and configure it to notify the SNS topic when the metric value is 1 or higher.
Explanation
This question tests knowledge of handling application log notifications in AWS. To receive email notifications when 'ERROR' appears in log lines, first select the log group, create a CloudWatch metric filter with 'ERROR' as the search pattern, then create an alarm on that metric and configure it to notify the SNS topic when the metric value is 1 or higher. Option A fully covers these necessary steps and satisfies the requirement. Other options are either incomplete or use incorrect methods.