Question #945
A company uses an AWS Lambda function to process daily batches of customer transactions. If a batch contains more than 10,000 transactions, the Lambda function must immediately publish a notification to an Amazon SNS topic.
Which combination of steps will meet this requirement with the LEAST implementation effort? (Choose two.)
Modify the existing Lambda function's code to send a custom Amazon CloudWatch metric indicating the number of transactions in each batch.
Create a new Lambda function subscribed to an Amazon Kinesis Data Stream that processes transaction counts and publishes to the SNS topic when the threshold is exceeded.
Configure an Amazon CloudWatch alarm to send a notification to the SNS topic when the custom metric exceeds 10,000.
Schedule an AWS Lambda function to analyze CloudWatch metrics every hour and publish to the SNS topic if any batch exceeds 10,000 transactions.
Update the existing Lambda function to write transaction counts to an Amazon DynamoDB table and use DynamoDB Streams to trigger a new Lambda function that publishes to the SNS topic.
Explanation
Answer A and C are correct because:
- A: Adding code to the existing Lambda function to emit a custom CloudWatch metric (transaction count) requires minimal code changes and leverages existing AWS services.
- C: A CloudWatch alarm can directly trigger an SNS notification when the metric exceeds 10,000, ensuring immediate action without delays.
Other options are incorrect because:
- B: Using Kinesis adds unnecessary complexity and requires new infrastructure.
- D: Hourly checks introduce delays, violating the 'immediately' requirement.
- E: DynamoDB and DynamoDB Streams add extra steps and components, increasing effort.
Key Points:
1. Use CloudWatch metrics/alarms for real-time thresholds.
2. Minimize new components to reduce implementation effort.
3. Immediate notifications require event-driven triggers (e.g., CloudWatch alarms), not scheduled checks.
Answer
The correct answer is: AC