Courseiva

DVA-C02 Development with AWS Services Practice Question

A developer is building a serverless application using AWS Lambda to process files uploaded to an S3 bucket. The Lambda function needs to read the uploaded file, transform it, and write the result to a DynamoDB table. Which IAM policy statement should be attached to the Lambda execution role?

⚠ Common exam trap

Test-takers frequently confuse the direction of data flow: candidates mistakenly choose write permissions for S3 (s3:PutObject) or read permissions for DynamoDB (dynamodb:GetItem), failing to map the correct action to each service based on whether data is being read from or written to that service.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

{"Effect":"Allow","Action":["s3:GetObject","dynamodb:PutItem"],"Resource":"*"}

The Lambda function needs to read the uploaded file from S3 (requiring s3:GetObject) and write the transformed result to DynamoDB (requiring dynamodb:PutItem). Option A correctly grants both actions with a wildcard resource, which is acceptable for a learning scenario but should be scoped in production. This matches the exact permissions needed for the described workflow.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    {"Effect":"Allow","Action":["s3:GetObject","dynamodb:PutItem"],"Resource":"*"}

    Why this is correct

    s3:GetObject correctly grants permission to download the uploaded file's bytes from the S3 bucket for processing, and dynamodb:PutItem correctly grants permission to insert or overwrite the transformed result as a new item, which matches the function's actual read-from-S3, write-to-DynamoDB data flow exactly.

  • ✗

    {"Effect":"Allow","Action":["s3:PutObject","dynamodb:PutItem"],"Resource":"*"}

    Why it's wrong here

    s3:PutObject only grants permission to upload or overwrite objects in the bucket; it does not authorize the Lambda function to retrieve the uploaded file's content, so the function would fail with an access-denied error the moment it attempts to read the object triggering the event.

  • ✗

    {"Effect":"Allow","Action":["s3:GetObject","dynamodb:UpdateItem"],"Resource":"*"}

    Why it's wrong here

    dynamodb:UpdateItem modifies specific attributes of an item that is expected to already exist and supports conditional expressions and atomic counters, but this scenario writes a brand-new transformed record for each uploaded file, which is the semantic purpose of PutItem rather than a partial update.

  • ✗

    {"Effect":"Allow","Action":["s3:GetObject","dynamodb:GetItem"],"Resource":"*"}

    Why it's wrong here

    dynamodb:GetItem only retrieves an existing item by primary key and grants no ability to persist the transformation output, so even though s3:GetObject correctly lets the function read the file, the function would still fail when it tries to write the transformed result into the table.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.