DVA-C02 exam dumps

DVA-C02 practice question 324 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 324

Single answer

You are building an application that processes images uploaded by users. The images are stored in an Amazon S3 bucket, and you need to trigger image processing automatically whenever a new image is uploaded. The solution must be serverless, scalable, and cost-efficient. Which approach should you take?

  1. A

    Configure an Amazon S3 Event Notification to trigger an AWS Lambda function when a new object is created.

  2. B

    Use Amazon S3 to directly invoke an Amazon EC2 instance that processes the image.

  3. C

    Attach an Amazon SQS queue to the S3 bucket and poll the queue using an application running on AWS Lambda.

  4. D

    Periodically poll the S3 bucket from an AWS Lambda function to detect new uploads and process them.

Show answer and explanation

Correct answer: A

Explanation

The best solution for this scenario is to use Amazon S3 Event Notifications to trigger an AWS Lambda function when a new object is created in the bucket. This approach leverages serverless services (S3 and Lambda), scales automatically, and avoids unnecessary complexities or costs associated with polling or using EC2 resources. It ensures the image processing workflow is triggered immediately after an upload, meeting the requirements effectively.

  • A. Correct.

    This is the correct answer. Amazon S3 Event Notifications can trigger an AWS Lambda function automatically when a new object is created in the bucket. This approach is serverless, scalable, and cost-efficient.

  • B. Incorrect.

    Amazon S3 cannot directly invoke an EC2 instance. Using EC2 would also require additional management and is not serverless, making this option incorrect.

  • C. Incorrect.

    While Amazon SQS can be used as a message queue, it cannot be directly attached to an S3 bucket in this scenario. S3 Event Notifications can directly trigger Lambda without needing SQS, so this option is unnecessarily complex.

  • D. Incorrect.

    Polling the S3 bucket periodically from a Lambda function is not efficient, as it incurs additional costs and introduces delays in detecting new uploads. Event-driven architecture via S3 Event Notifications is a better solution.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam