Bird
0
0

You want to create a Lambda function that processes images uploaded to an S3 bucket. Which combination of settings is required to ensure the Lambda runs automatically when a new image is uploaded?

hard📝 Best Practice Q15 of 15
AWS - Lambda
You want to create a Lambda function that processes images uploaded to an S3 bucket. Which combination of settings is required to ensure the Lambda runs automatically when a new image is uploaded?
ASet Lambda runtime to Node.js and upload images directly to Lambda
BManually invoke Lambda after uploading images to S3
CSet S3 event trigger on bucket for 'ObjectCreated' and assign Lambda execution role with S3 read permissions
DCreate an EC2 instance to monitor S3 and call Lambda
Step-by-Step Solution
Solution:
  1. Step 1: Configure S3 event trigger

    To run Lambda automatically on uploads, configure S3 to trigger Lambda on 'ObjectCreated' events.
  2. Step 2: Assign correct IAM role permissions

    Lambda needs an execution role with permissions to read from S3 to process images.
  3. Final Answer:

    Set S3 event trigger on bucket for 'ObjectCreated' and assign Lambda execution role with S3 read permissions -> Option C
  4. Quick Check:

    S3 trigger + IAM role = automatic Lambda run [OK]
Quick Trick: Use S3 event triggers with proper IAM role [OK]
Common Mistakes:
  • Thinking manual invocation is automatic
  • Confusing runtime with event triggers
  • Using EC2 unnecessarily for Lambda triggers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes