AWS Certified Developer – Associate / Question #671 of 557

Question #671

A company is developing an application that handles .json files stored in Amazon S3. A developer has set up an S3 bucket and an AWS Lambda function to process the .json files. Which combination of steps will ensure the Lambda function is invoked automatically when a .json file is uploaded to the S3 bucket? (Choose two.)

A

Create an Amazon EventBridge rule. Configure the rule with an event pattern matching the S3 Object Created event for .json files.

B

Schedule an Amazon EventBridge rule to trigger a new Lambda function that periodically checks the S3 bucket for new .json files.

C

Add a trigger to the existing Lambda function. Set the trigger source to EventBridge and associate it with the configured Amazon EventBridge rule.

D

Develop a new Lambda function to poll the S3 bucket for newly uploaded .json files and process them.

E

Configure S3 Lifecycle policies to trigger the existing Lambda function upon .json file uploads.

Explanation

To automatically invoke a Lambda function when a .json file is uploaded to S3:

- A is correct because EventBridge can capture S3 events and trigger Lambda based on specific patterns (e.g., file extension).
- C is correct because the Lambda trigger must be linked to the EventBridge rule to process the event.

Other options are incorrect:
- B and D involve inefficient polling instead of event-driven triggers.
- E uses S3 Lifecycle policies, which manage object transitions, not event triggers.

Key Points: Use EventBridge rules for custom event patterns and link them to Lambda triggers for serverless, event-driven architectures.

Answer

The correct answer is: AC