Question 292 of 724
DVA-C02 Deployment Practice Question
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?
⚠ Common exam trap
Watch out — 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.
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
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.
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
An AWS::IAM::Role is the correct and standard mechanism for granting a Lambda function the necessary permissions to interact with other AWS services, such as reading from an S3 bucket. This resource defines an identity that the Lambda function assumes during execution, specified by an `AssumeRolePolicyDocument` allowing the `lambda.amazonaws.com` service principal. Attached policies within the role then explicitly define the actions (e.g., `s3:GetObject`) the function is authorized to perform on specified resources.
- ✗
AWS::Lambda::Permission
Why it's wrong here
AWS::Lambda::Permission is used to grant another AWS service or account the explicit permission to invoke a specific Lambda function. This resource creates a resource-based policy directly on the Lambda function itself, allowing services like S3, API Gateway, or CloudWatch Events to trigger it. It does not, however, grant the Lambda function any outbound permissions to access other AWS resources; its sole purpose is to manage inbound invocation access.
- ✗
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
An AWS::IAM::ManagedPolicy defines a reusable set of permissions that can be attached to multiple IAM identities, such as users, groups, or roles. While a managed policy is crucial for specifying the actual permissions (e.g., `s3:GetObject`), it is not an identity that can be directly assumed by a Lambda function. The `AWS::IAM::Role` is the primary identity resource that holds these policies and is assumed by the Lambda function to gain the specified permissions.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
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 →
Last reviewed: Jun 11, 2026
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.
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.
Sign in to join the discussion.