DVA-C02 exam dumps

DVA-C02 practice question 36 of 399

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

DVA-C02 Question 36

Select 2

You are developing an AWS Lambda function to process data from an Amazon S3 bucket. The function should trigger whenever a new object is uploaded to the bucket. You also need to ensure that the function has the necessary permissions to read from the bucket. Which of the following steps are required to achieve this setup?

  1. A

    Create an Event Notification on the S3 bucket to trigger the Lambda function on the 's3:ObjectCreated:*' event.

  2. B

    Attach an IAM policy to the Lambda function's execution role that allows the 's3:GetObject' permission for the S3 bucket.

  3. C

    Configure the Lambda function to poll the S3 bucket for new objects every minute.

  4. D

    Add an Event Bridge rule to trigger the Lambda function whenever an object is created in the S3 bucket.

  5. E

    Ensure the S3 bucket policy allows 's3:PutObject' permission for the Lambda function.

Show answer and explanation

Correct answers: A, B

Explanation

To process new objects in an S3 bucket using Lambda, you need to configure an Event Notification on the S3 bucket for the 's3:ObjectCreated:*' event and ensure the Lambda function's execution role has the 's3:GetObject' permission to read the objects. Polling the bucket or using EventBridge is unnecessary, and 's3:PutObject' permission is irrelevant in this context unless the Lambda function needs to upload objects.

  • A. Correct.

    Correct: An Event Notification on the S3 bucket is required to trigger the Lambda function on the 's3:ObjectCreated:*' event.

  • B. Correct.

    Correct: The Lambda function's execution role must have the 's3:GetObject' permission to read data from the S3 bucket.

  • C. Incorrect.

    Incorrect: AWS Lambda cannot poll an S3 bucket; instead, S3 Event Notifications are used to trigger Lambda functions.

  • D. Incorrect.

    Incorrect: EventBridge rules are not used to trigger Lambda functions directly from S3 events. S3 Event Notifications handle this integration.

  • E. Incorrect.

    Incorrect: The S3 bucket does not need 's3:PutObject' permission for the Lambda function in this scenario because the Lambda function is not uploading objects to the bucket.

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