Question 292 of 1,616
DeploymentmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct resource to define is AWS::IAM::Role. This is because Lambda functions do not inherently have permissions to access any AWS services; they must assume an IAM role at runtime that grants the necessary access. In a CloudFormation template, you define an IAM role with a policy document that includes the s3:GetObject action on the specific S3 bucket ARN, and you attach a trust policy allowing lambda.amazonaws.com to assume that role. On the AWS Certified Developer Associate DVA-C02 exam, this question tests your understanding of the principle of least privilege and the separation of permissions from the function code. A common trap is to confuse AWS::Lambda::Permission (which grants other services permission to invoke Lambda) with the IAM role that grants Lambda itself access to other resources. Remember: Lambda assumes a role to act; it does not inherit permissions from the bucket policy alone. A helpful memory tip is "Lambda needs a Role to read a S3 object."

DVA-C02 Deployment Practice Question

This DVA-C02 practice question tests your understanding of deployment. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A developer is using AWS CloudFormation to deploy a stack that includes an Amazon S3 bucket and an AWS Lambda function. The Lambda function needs to be granted permission to read objects from the S3 bucket. Which resource should the developer define in the CloudFormation template to provide these permissions?

Question 1mediummultiple choice
Full question →

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

AWS::IAM::Role

Option A is correct because the Lambda function requires an IAM role (AWS::IAM::Role) with a policy that grants s3:GetObject permissions on the S3 bucket. This role is assumed by the Lambda service at runtime, allowing the function to read objects from the bucket. The role must include a trust policy that allows lambda.amazonaws.com to assume it.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • AWS::IAM::Role

    Why this is correct

    Correct. An IAM role with an appropriate policy (e.g., allowing s3:GetObject) is the correct way to grant the Lambda function permissions to read from the S3 bucket.

    Related concept

    Read the scenario before looking for a memorised answer.

  • AWS::Lambda::Permission

    Why it's wrong here

    Incorrect. AWS::Lambda::Permission is used to grant other services (like S3) permission to invoke the Lambda function, not to grant the function permissions to access other resources.

  • AWS::S3::BucketPolicy

    Why it's wrong here

    Incorrect. A bucket policy controls access to the S3 bucket, but the Lambda function would also need an IAM role. Using a bucket policy alone would require knowing the principal ARN; typically the IAM role approach is cleaner for EC2/Lambda.

  • AWS::IAM::ManagedPolicy

    Why it's wrong here

    Incorrect. While a managed policy can be attached to a role, it is not a resource that directly grants permissions; the role is the primary resource that holds the permissions.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse resource-based policies (like S3 bucket policies or Lambda permission statements) with identity-based policies (like IAM roles), thinking a bucket policy alone can grant the Lambda function access, when in fact the Lambda function needs an IAM role with the appropriate permissions to assume and use.

Detailed technical explanation

How to think about this question

Under the hood, the Lambda execution role is assumed via the AWS Security Token Service (STS) using the AssumeRole API call. The trust policy on the role must include a statement with 'Service': 'lambda.amazonaws.com' as the principal. The permissions policy attached to the role (either inline or via managed policies) defines the S3 actions allowed. In real-world scenarios, you would also include a resource ARN for the specific S3 bucket and objects to follow least privilege.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DVA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DVA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DVA-C02 question test?

Deployment — This question tests Deployment — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: AWS::IAM::Role — Option A is correct because the Lambda function requires an IAM role (AWS::IAM::Role) with a policy that grants s3:GetObject permissions on the S3 bucket. This role is assumed by the Lambda service at runtime, allowing the function to read objects from the bucket. The role must include a trust policy that allows lambda.amazonaws.com to assume it.

What should I do if I get this DVA-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.