DVA-C02 · Question #402
A company has an application that receives batches of orders from partners every day. The application uses an AWS Lambda function to process the batches. If a batch contains no orders, the Lambda func
The correct answer is A. Update the existing Lambda function's code to send an Amazon CloudWatch custom metric for C. Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value. Detecting an empty-batch condition in Lambda and notifying SNS with minimal effort is best achieved by publishing a custom CloudWatch metric from the function and triggering a CloudWatch alarm on that metric.
Question
A company has an application that receives batches of orders from partners every day. The application uses an AWS Lambda function to process the batches. If a batch contains no orders, the Lambda function must publish to an Amazon Simple Notification Service (Amazon SNS) topic as soon as possible. Which combination of steps will meet this requirement with the LEAST implementation effort? (Choose two.)
Options
- AUpdate the existing Lambda function's code to send an Amazon CloudWatch custom metric for
- BCreate a new Lambda function as an Amazon Kinesis data stream consumer. Configure the new
- CSet up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value
- DSchedule a new Lambda function to analyze Amazon CloudWatch metrics every 24 hours to
- EModify the existing Lambda function to log orders to an Amazon Kinesis data stream.
How the community answered
(53 responses)- A64% (34)
- B19% (10)
- D6% (3)
- E11% (6)
Why each option
Detecting an empty-batch condition in Lambda and notifying SNS with minimal effort is best achieved by publishing a custom CloudWatch metric from the function and triggering a CloudWatch alarm on that metric.
The existing Lambda function can call the CloudWatch PutMetricData API to publish a custom metric (e.g., EmptyBatchCount) whenever a batch contains no orders, requiring only a few lines of code.
Creating a new Lambda function as a Kinesis consumer introduces unnecessary infrastructure and effort unrelated to the empty-batch detection requirement.
A CloudWatch alarm can be configured to trigger when the custom metric value exceeds 0 and directly publish to the SNS topic, completing the notification pipeline without any additional infrastructure or Lambda functions.
Scheduling a function to analyze metrics every 24 hours violates the 'as soon as possible' requirement and adds unnecessary delay and implementation work.
Logging orders to a Kinesis data stream adds significant implementation complexity and is not needed for a simple empty-batch notification.
Concept tested: CloudWatch custom metrics and alarms for Lambda event notification
Source: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
Community Discussion
No community discussion yet for this question.