AWS Certified Developer – Associate / Question #893 of 557

Question #893

A company with multiple retail stores uploads daily transaction logs to an Amazon S3 bucket every evening. The company uses an AWS Lambda function to process all logs collectively once each night at a fixed time. The Lambda function aggregates the data and stores it in a DynamoDB table.

The company wants to initiate the processing exactly once each night at the specified time.

Which solution meets these requirements MOST cost-effectively?

A

Configure an S3 event notification to invoke the Lambda function when a store uploads a transaction log.

B

Create an AWS Step Functions state machine that invokes the Lambda function once each night at the specified time.

C

Configure the Lambda function to run continuously and begin processing only at the predefined time each night.

D

Create an Amazon EventBridge scheduled rule that invokes the Lambda function once each night at the specified time.

Explanation

Answer D is correct because:
- EventBridge Scheduled Rules: Enable precise scheduling (e.g., cron expressions) to invoke Lambda once nightly, aligning with the requirement for fixed-time processing. It is serverless, cost-effective, and requires minimal setup.

Why other options are incorrect:
- A: S3 event notifications trigger Lambda for every upload, leading to multiple invocations (once per store upload), not once per night.
- B: Step Functions adds orchestration complexity and costs for a simple scheduled task.
- C: Running Lambda continuously wastes resources and incurs unnecessary costs.

Key Points: Use EventBridge for scheduled, single-invocation tasks. Avoid S3 event notifications for batched processing. Step Functions is overkill for simple schedules.

Answer

The correct answer is: D