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 events to CloudWatch Logs. Using CloudWatch Logs Insights, you can query logs for unique customers with order quantity equal to 0 and group the results by 1-day periods, which is required for the dashboard.
AWS CloudTrail logs API calls, not application-level data like order quantities. Using Athena to query CloudTrail logs won’t provide the necessary information about order quantities or customer data in this scenario.
EventBridge is not suitable for logging and processing historical data like order quantities. It’s more useful for event-driven architectures and real-time event routing, not for querying past order data.
DynamoDB streams provide change data and are not directly tied to custom CloudWatch metrics. Creating a CloudWatch alarm for this scenario would not be effective for counting unique customers or tracking specific data like order quantities.