Q91 — AWS DVA-C02 Ch.1
Question 91 of 100 | ← Chapter 1
A company configured an Amazon S3 bucket to send S3 object events to Amazon EventBridge (Amazon CloudWatch Events). An EventBridge rule invokes an AWS Lambda function for each object event received from the S3 bucket. A developer is building a new version of the Lambda function. To ensure the new Lambda function behaves as expected, the developer must perform repeatable tests using real S3 object events. The developer must minimize the amount of code and infrastructure required to support testing. Which solution meets these requirements?
- A. Create another S3 bucket that sends object events to EventBridge. Add another EventBridge rule to route data events from the new S3 bucket to the new Lambda function. Develop a tool to update objects in the new S3 bucket to generate test S3 object events.
- B. Add the new Lambda function as an additional target to the existing EventBridge rule. Route S3 object events to both the existing and new Lambda functions simultaneously.
- C. Use EventBridge archive and replay production S3 object events. Configure a new EventBridge rule to deliver the replayed S3 object events to the new Lambda function. ✓
- D. Develop a tool that uses the EventBridge PutEvents API operation to publish aws.s3 data events. Add a new EventBridge rule to route aws.s3 events to the new Lambda function.
Correct Answer: C. Use EventBridge archive and replay production S3 object events. Configure a new EventBridge rule to deliver the replayed S3 object events to the new Lambda function.
Explanation
Option C is the most appropriate solution. Using EventBridge archive and replay of production S3 object events allows direct use of real event data for testing, eliminating the need to create new buckets or develop complex tools to generate test events—thus minimizing code and infrastructure required for testing. Option A requires creating a new bucket and developing a tool, increasing complexity; Option B routes events to both old and new functions simultaneously, potentially causing confusion and failing to isolate testing of the new function; Option D requires unnecessary development effort to build a PutEvents-based tool. Therefore, Option C best satisfies the requirements.