DVA-C02 exam dumps

DVA-C02 practice question 361 of 399

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

DVA-C02 Question 361

Single answer

You are developing a serverless application that uses AWS Lambda to process data from an Amazon S3 bucket. The application must ensure that Lambda is triggered whenever a specific S3 bucket receives a new object. What is the best way to configure this integration?

  1. A

    Create an EventBridge rule to monitor the S3 bucket and invoke the Lambda function.

  2. B

    Configure an S3 Event Notification on the bucket to trigger the Lambda function.

  3. C

    Write a custom polling mechanism in the Lambda function to check the S3 bucket for new objects.

  4. D

    Manually invoke the Lambda function whenever a new object is uploaded to the S3 bucket.

Show answer and explanation

Correct answer: B

Explanation

The best way to trigger a Lambda function when a new object is added to an S3 bucket is to use the native S3 Event Notifications feature. This allows you to configure the S3 bucket to automatically invoke the Lambda function upon specific events (e.g., object creation). This approach is efficient, automated, and aligns well with serverless best practices.

  • A. Incorrect.

    EventBridge is not the recommended approach for direct S3-to-Lambda integration. While EventBridge can monitor S3 events, it adds unnecessary complexity for this use case.

  • B. Correct.

    An S3 Event Notification is the correct way to trigger a Lambda function when a new object is added to the bucket. This is a native integration between S3 and Lambda.

  • C. Incorrect.

    Using a custom polling mechanism is inefficient and not scalable. AWS offers native services like S3 Event Notifications to handle such use cases.

  • D. Incorrect.

    Manually invoking the Lambda function is impractical and defeats the purpose of an automated serverless architecture.

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