AWS Certified Developer – Associate (DVA-C02) — Question 426
An ecommerce startup is preparing for an annual sales event. As the traffic to the company's application increases, the development team wants to be notified when the Amazon EC2 instance's CPU utilization exceeds 80%.
Which solution will meet this requirement?
Answer options
- A. Create a custom Amazon CloudWatch alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
- B. Create a custom AWS CloudTrail alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
- C. Create a cron job on the EC2 instance that invokes the --describe-instance-information command on the host instance every 15 minutes and sends the results to an Amazon SNS topic.
- D. Create an AWS Lambda function that queries the AWS CloudTrail logs for the CPUUtilization metric every 15 minutes and sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
Correct answer: A
Explanation
Amazon CloudWatch natively monitors host-level metrics like CPU utilization for Amazon EC2 instances, making a CloudWatch alarm the standard and most efficient way to trigger an Amazon SNS notification when thresholds are breached. AWS CloudTrail is designed for auditing API calls rather than tracking real-time performance metrics like CPU usage, ruling out options B and D. Running a cron job on the instance to query metadata (Option C) is inefficient and the --describe-instance-information command does not provide CPU utilization metrics.