IoT devices upload a data file once per hour to an Amazon S3 bucket. A Lambda function is configured to process these files and should run immediately when each file is uploaded. The Lambda function is already configured with the S3 bucket information. How should the developer ensure the function is invoked as soon as a file is uploaded?
Choose an answer
Tap an option to check your answer.
Correct answer: Add an S3 trigger to the Lambda function and select the S3 bucket as the event source..
Why this is the answer
The correct approach is to add an S3 trigger directly to the Lambda function. This configuration establishes a direct event source mapping where S3 events (like object creation) automatically invoke the specified Lambda function. This ensures the function runs immediately after each file upload, as required. Asynchronous invocation is a property of how a Lambda function is called, not how it's triggered by an S3 event. While S3 triggers Lambda asynchronously, you don't configure "asynchronous invocation" on the Lambda function itself for S3. EventBridge can be used for S3 events, but adding an S3 trigger directly to the Lambda function is the most common and straightforward method for this use case. Lambda layers are used to package code and dependencies, not to define event sources.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed