
Answer-first summary for fast verification
Answer: Create a CloudWatch metric filter for error pattern matching, establish an alarm, and set it to notify via SNS when the error count crosses the threshold.
The correct answer is D. To meet the requirement of sending an SNS notification when the number of application error messages exceeds a defined threshold within a 5-minute period, you should create a CloudWatch metric filter to detect the error pattern in the logs. Based on this custom metric, you can then create a CloudWatch alarm that is set to trigger when the defined threshold is exceeded. Finally, configure the alarm to send an SNS notification. This approach leverages built-in AWS monitoring and alerting capabilities without the need for code modifications or additional agents.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can a company set up a notification system for its web application hosted on Amazon EC2, using Amazon CloudWatch Logs and Amazon SNS, to alert when the error message count exceeds a specific threshold within 5 minutes?
A
Modify application code for direct SNS logging and configure an SNS topic for error threshold notifications.
B
Use CloudWatch Logs subscription filters to trigger SNS notifications upon exceeding the error threshold.
C
Deploy Amazon Inspector on EC2 instances for error monitoring and configure it for SNS notifications at the error threshold.
D
Create a CloudWatch metric filter for error pattern matching, establish an alarm, and set it to notify via SNS when the error count crosses the threshold.
No comments yet.