DVA-C02 exam dumps

DVA-C02 practice question 282 of 399

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

DVA-C02 Question 282

Single answer

You are developing a serverless application using AWS Lambda and need to integrate it with an Amazon S3 bucket to process uploaded files. The Lambda function must be triggered automatically whenever a new file is added to the bucket. How can you achieve this functionality?

  1. A

    Configure an S3 event notification on the bucket to invoke the Lambda function when an object is created.

  2. B

    Set up a CloudWatch Events rule to monitor the S3 bucket and invoke the Lambda function for every file upload.

  3. C

    Use the AWS SDK to periodically poll the S3 bucket from the Lambda function for newly uploaded files.

  4. D

    Enable versioning on the S3 bucket and configure it to trigger the Lambda function for each new version of an object.

Show answer and explanation

Correct answer: A

Explanation

The best way to integrate an Amazon S3 bucket with a Lambda function is by configuring S3 event notifications. This allows the bucket to invoke the Lambda function automatically whenever a specific event, such as an object creation, occurs. This is an efficient and serverless approach to achieving the required functionality.

  • A. Correct.

    Correct. Amazon S3 supports event notifications, which can be configured to invoke a Lambda function whenever an object is created in the bucket.

  • B. Incorrect.

    Incorrect. CloudWatch Events is not designed to monitor S3 bucket events directly; S3 event notifications are the appropriate mechanism.

  • C. Incorrect.

    Incorrect. Polling the bucket is not an efficient or recommended approach when S3 event notifications can provide real-time triggering.

  • D. Incorrect.

    Incorrect. While enabling versioning is useful for object version control, it is not required to trigger Lambda functions for new object uploads.

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