Bird
0
0

You want a Lambda function to process only PNG files uploaded to an S3 bucket. How should you configure the S3 event trigger to achieve this?

hard📝 Application Q15 of 15
AWS - Serverless Architecture
You want a Lambda function to process only PNG files uploaded to an S3 bucket. How should you configure the S3 event trigger to achieve this?
ASet the event type to 's3:ObjectCreated:Put' without any filters.
BSet the event type to 's3:ObjectRemoved:*' and add a prefix filter '.png'.
CConfigure the Lambda function code to ignore non-PNG files without using filters.
DSet the event type to 's3:ObjectCreated:*' and add a filter with suffix '.png' in the bucket notification configuration.
Step-by-Step Solution
Solution:
  1. Step 1: Use event type for object creation

    Use 's3:ObjectCreated:*' to capture all create events including uploads.
  2. Step 2: Apply suffix filter for '.png'

    Configure the bucket notification with a filter to trigger Lambda only for files ending with '.png'.
  3. Final Answer:

    Set the event type to 's3:ObjectCreated:*' and add a filter with suffix '.png' in the bucket notification configuration. -> Option D
  4. Quick Check:

    Use event filters to limit Lambda triggers by file type [OK]
Quick Trick: Use suffix filter '.png' in S3 event trigger for file type filtering [OK]
Common Mistakes:
  • Using ObjectRemoved event instead of ObjectCreated
  • Relying only on Lambda code filtering without event filters
  • Using prefix filter with file extension instead of suffix

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes