csv file is uploaded to Amazon S3?
(Choose two.)
Create an Amazon EventBridge rule. Configure the rule with a pattern to match the S3 object created event.
Schedule an Amazon EventBridge rule to run a new Lambda function to scan the S3 bucket.
Add a trigger to the existing Lambda function. Set the trigger type to EventBridge. Select the Amazon EventBridge rule.
Create a new Lambda function to scan the S3 bucket for recently added S3 objects.
Add S3 Lifecycle rules to invoke the existing Lambda function.
Explanations:
Creating an EventBridge rule with a pattern to match the S3 object created event will trigger the Lambda function when a new .csv file is uploaded to S3. This is a common approach to automate processing based on S3 events.
Scheduling an EventBridge rule to run a new Lambda function to scan the S3 bucket is not an efficient way to trigger the Lambda function on every upload. The function should be triggered by an event, not by a schedule.
Adding a trigger to the Lambda function with EventBridge will allow the Lambda function to be invoked when a relevant S3 event occurs. This is the correct way to link the Lambda function to an S3 event.
Creating a new Lambda function to scan the S3 bucket is redundant. Lambda functions should be invoked directly by an event (e.g., file upload) rather than scanning the bucket periodically.
S3 Lifecycle rules are used for managing the lifecycle of objects in the S3 bucket, such as transitioning to different storage classes or deleting objects. They do not trigger Lambda functions for file uploads.