DVA-C02 exam dumps

DVA-C02 practice question 35 of 399

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

DVA-C02 Question 35

Select 2

You are developing an AWS Lambda function that processes images uploaded to an S3 bucket. The function should automatically trigger whenever a new image is uploaded to the bucket, and the processed results should be stored in another S3 bucket. Which of the following steps are required to accomplish this task?

  1. A

    Create an S3 event notification on the source bucket to invoke the Lambda function when a new object is created.

  2. B

    Assign an IAM role to the Lambda function with permissions to read from the source bucket and write to the destination bucket.

  3. C

    Configure the Lambda function's runtime environment to include the AWS SDK for S3 interactions.

  4. D

    Manually poll the source S3 bucket for new objects using a scheduled Lambda function invocation.

  5. E

    Add a CloudWatch Events rule to trigger the Lambda function on object creation in the S3 bucket.

Show answer and explanation

Correct answers: A, B

Explanation

To process images uploaded to an S3 bucket with a Lambda function, you must configure an S3 event notification on the source bucket to trigger the Lambda function on object creation. Additionally, the Lambda function requires an IAM role with permissions to read from the source bucket and write to the destination bucket. Other options involve unnecessary or incorrect steps for this specific use case.

  • A. Correct.

    Correct: S3 event notifications are used to trigger a Lambda function when specific events (e.g., object creation) occur in a bucket. This is a core step for the task.

  • B. Correct.

    Correct: The Lambda function needs an IAM role with appropriate permissions to read from the source bucket and write to the destination bucket to perform its task.

  • C. Incorrect.

    Incorrect: The AWS SDK is pre-installed in the Lambda runtime environments (e.g., Node.js, Python), so explicitly including it is unnecessary.

  • D. Incorrect.

    Incorrect: Polling the S3 bucket manually using a scheduled invocation is inefficient and not required, as S3 provides event notification integration with Lambda.

  • E. Incorrect.

    Incorrect: CloudWatch Events rules are not used for triggering Lambda functions based on S3 events. Instead, S3 event notifications should be configured.

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