Discover the most efficient AWS Lambda configuration to process daily order batches and notify via SNS when batches are empty, optimizing your AWS Certified Developer workflow.
Table of Contents
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.)
A. Update the existing Lambda function’s code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
B. Create a new Lambda function as an Amazon Kinesis data stream consumer. Configure the new Lambda function to track orders and to publish to the SNS topic when a batch contains no orders.
C. Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
D. Schedule a new Lambda function to analyze Amazon CloudWatch metrics every 24 hours to identify batches that contain no orders. Configure the Lambda function to publish to the SNS topic.
E. Modify the existing Lambda function to log orders to an Amazon Kinesis data stream.
Answer
To address this scenario with the least implementation effort, the most effective combination of steps would be:
A. Update the existing Lambda function’s code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
C. Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
Explanation
To address this scenario with the least implementation effort, the most effective combination of steps would be:
A. Update the existing Lambda function’s code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
C. Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
Here’s a detailed explanation of why these two steps are the most efficient solution:
Updating the existing Lambda function (Option A):
- This approach leverages the existing infrastructure, reducing the need for creating new resources.
- By adding a simple code modification to emit a custom metric, we can track the number of orders in each batch.
- This method is straightforward and requires minimal changes to the current setup.
Setting up a CloudWatch alarm (Option C):
- CloudWatch alarms can monitor metrics and trigger actions based on predefined thresholds.
- By creating an alarm that activates when the custom metric value is 0, we can immediately detect empty batches.
- The alarm can be configured to publish directly to the SNS topic, fulfilling the requirement of notifying “as soon as possible.”
This combination provides several advantages:
- It utilizes existing resources (the Lambda function and SNS topic).
- It requires minimal code changes and configuration.
- It allows for real-time monitoring and notification.
- It’s scalable and can handle multiple partners and batches efficiently.
The other options are less suitable for the following reasons:
Option B: Creating a new Lambda function and Kinesis data stream is more complex and resource-intensive than necessary for this task.
Option D: Scheduling a Lambda function to analyze metrics every 24 hours doesn’t meet the requirement of notifying “as soon as possible.”
Option E: While logging to a Kinesis data stream could be useful for other purposes, it adds unnecessary complexity for this specific requirement and doesn’t directly solve the notification problem.
In conclusion, by implementing options A and C, the company can efficiently monitor order batches and quickly notify via SNS when a batch contains no orders, all with minimal implementation effort and maximum use of existing AWS services.
Amazon AWS Certified Developer – Associate DVA-C02 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Developer – Associate DVA-C02 exam and earn Amazon AWS Certified Developer – Associate DVA-C02 certification.