Which solution will meet these requirements?
Add an asynchronous invocation to the Lambda function. Select the S3 bucket as the source.
Add an Amazon EventBridge event to the Lambda function. Select the S3 bucket as the source.
Add a trigger to the Lambda function. Select the S3 bucket as the source.
Add a layer to the Lambda function. Select the S3 bucket as the source.
Explanations:
Adding an asynchronous invocation to the Lambda function does not directly set up the Lambda to trigger on S3 events. This option is not applicable in this context as the Lambda needs to be invoked by the S3 event itself, not through an asynchronous invocation setup.
While EventBridge can be used to route events and could theoretically be configured to trigger a Lambda function, it is not the most direct or common method for responding to S3 file uploads. EventBridge is more complex and is typically used for broader event-driven architectures.
This is the correct option as it directly sets up the Lambda function to be invoked automatically when a new file is uploaded to the specified S3 bucket. By configuring an S3 bucket as a trigger for the Lambda function, the function is invoked in real-time upon file uploads.
Adding a layer to the Lambda function does not relate to triggering the function. Layers are used for including additional code and dependencies, not for setting up event sources or triggers for the Lambda function.