AWS Certified Developer – Associate (DVA-C02) — Question 326

A company deploys a new application to AWS. The company is streaming application logs to Amazon CloudWatch Logs. The company's development team must receive notification by email when the word "ERROR" appears in any log lines. A developer sets up an Amazon Simple Notification Service (Amazon SNS) topic and subscribes the development team to the topic.

What should the developer do next to meet the requirements?

Answer options

Correct answer: A

Explanation

To trigger an SNS notification based on specific log contents, you must first create a CloudWatch metric filter on the appropriate log group to convert log patterns into a numerical metric. You can then create a CloudWatch alarm on that metric that triggers an action to notify the SNS topic when the metric count is 1 or greater. Other options are incorrect because CloudWatch Logs Insights is for interactive log analysis, subscription filters do not route directly to SNS, and CloudWatch alarms cannot filter log patterns without an underlying metric filter.