What should the developer do to implement the dashboard?
Grant the Lambda function’s execution role permissions to upload logs to Amazon CloudWatch Logs. Implement a CloudWatch Logs Insights query that selects the number of unique customers for orders with order quantity equal to 0 and groups the results in 1-day periods. Add the CloudWatch Logs Insights query to a CloudWatch dashboard.
Use Amazon Athena to query AWS CloudTrail API logs for API calls. Implement an Athena query that selects the number of unique customers for orders with order quantity equal to 0 and groups the results in 1-day periods. Add the Athena query to an Amazon CloudWatch dashboard.
Configure the Lambda function to send events to Amazon EventBridge. Create an EventBridge rule that groups the number of unique customers for orders with order quantity equal to 0 in 1-day periods. Add a CloudWatch dashboard as the target of the rule.
Turn on custom Amazon CloudWatch metrics for the DynamoDB stream of the DynamoDB table. Create a CloudWatch alarm that groups the number of unique customers for orders with order quantity equal to 0 in 1-day periods. Add the CloudWatch alarm to a CloudWatch dashboard.
Explanations:
The Lambda function can log the data to CloudWatch Logs. Using CloudWatch Logs Insights, a query can be written to filter orders with a quantity of 0 and group the results by day to track unique customers. This can be added to a CloudWatch dashboard for monitoring.
Athena is used to query data stored in Amazon S3. However, CloudTrail API logs track API requests and are not directly related to order data from DynamoDB streams. Therefore, using Athena for this scenario is inappropriate.
EventBridge rules are used for event-driven architecture, but they are not designed for aggregating data like counting unique customers for specific order conditions. EventBridge is not the right service to process order quantity data and group results by day.
CloudWatch alarms are typically used for monitoring thresholds and not for aggregating unique customer data. Also, CloudWatch alarms do not provide detailed aggregation or querying capabilities like CloudWatch Logs Insights for this scenario.