Q14 — AWS DVA-C02 Ch.1
Question 14 of 100 | ← Chapter 1
A company is building a serverless application on AWS. The application uses an AWS Lambda function to process customer orders 24/7. The Lambda function calls an external payment processing system’s HTTP API. During load testing, developers observed occasional timeouts and errors returned by the external API. The company expects some payment API calls to fail. The company wants the support team to receive near real-time notifications only when the external payment API error rate exceeds 5% of total transactions per hour. Developers must use an existing Amazon Simple Notification Service (Amazon SNS) topic configured to notify the support team. Which solution meets these requirements?
- A. Write payment API call results to Amazon CloudWatch Logs. Use Amazon CloudWatch Logs Insights to query logs. Schedule a Lambda function to check logs and notify the existing SNS topic.
- B. Publish custom metrics to CloudWatch to record failures of external payment API calls. Configure a CloudWatch alarm to notify the existing SNS topic when the error rate exceeds the threshold. ✓
- C. Publish external payment API call results to a new Amazon SNS topic. Subscribe support team members to the new SNS topic.
- D. Write external payment API call results to Amazon S3. Schedule periodic Amazon Athena queries. Configure Athena to send notifications to the existing SNS topic when the error rate exceeds the threshold.
Correct Answer: B. Publish custom metrics to CloudWatch to record failures of external payment API calls. Configure a CloudWatch alarm to notify the existing SNS topic when the error rate exceeds the threshold.
Explanation
Option B correctly implements near real-time monitoring: publishing custom CloudWatch metrics for payment API failures enables precise error-rate calculation, and CloudWatch alarms trigger notifications to the existing SNS topic when thresholds are exceeded—meeting the requirement for conditional, timely alerts. Option A relies on log scanning, introducing latency and inefficiency. Option C violates the constraint of using the *existing* SNS topic. Option D uses S3 + Athena, which is batch-oriented and unsuitable for near real-time notification. Thus, Option B is correct.