DVA-C02 Development with AWS Services Practice Question
A developer has an Amazon S3 bucket containing private user documents. The application must generate a time-limited URL for users to download their own documents without requiring the users to have AWS credentials. Which solution should the developer use?
⚠ Common exam trap
Watch out — candidates often confuse pre-signed URLs with CloudFront signed URLs, thinking the CDN is required for time-limited access, but pre-signed URLs work directly with S3 and are simpler for single-object, time-limited downloads without needing CloudFront.
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
✓
Create a pre-signed URL for each object using the AWS SDK with an appropriate expiration time.
Pre-signed URLs allow temporary, time-limited access to private S3 objects without requiring the user to have AWS credentials. The developer generates the URL server-side using the AWS SDK, embedding an expiration time, and the user can download the object directly via HTTP GET. This meets the requirement of granting ephemeral access to specific documents for unauthenticated users.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use CloudFront signed URLs with an origin access identity (OAI) to restrict access to the S3 bucket.
Why it's wrong here
CloudFront signed URLs are designed to control access to content delivered through the CloudFront CDN, not for direct, temporary access to individual S3 objects. While an Origin Access Identity (OAI) or Origin Access Control (OAC) restricts direct S3 bucket access, this solution introduces unnecessary complexity and latency if the primary goal is to provide secure, time-limited direct links to private S3 documents. It's an architectural mismatch for the specific requirement of granting temporary S3 object access.
- ✓
Create a pre-signed URL for each object using the AWS SDK with an appropriate expiration time.
Why this is correct
Creating a pre-signed URL for each object using the AWS SDK is the most secure and efficient method for granting temporary access to private S3 objects. This URL, generated with the developer's AWS credentials and a specified expiration time, allows any recipient to perform a specific action (e.g., GET) on the object directly from S3 without needing their own AWS credentials. It provides granular, time-limited access, perfectly aligning with the need for secure access to private user documents.
- ✗
Set a bucket policy that allows public read access for the specific users based on their IP addresses.
Why it's wrong here
Setting a bucket policy to allow public read access, even when restricted by IP addresses, is generally inappropriate for private user documents. End-user IP addresses are often dynamic, making this approach unreliable and difficult to manage at scale. More critically, it grants persistent access to anyone from those IPs rather than temporary, per-object access, failing to meet the requirement for secure, time-limited access to individual private documents.
- ✗
Provide the users with IAM user credentials that have read access to the bucket.
Why it's wrong here
Directly providing IAM user credentials to end-users is a severe security anti-pattern and violates fundamental security best practices. This approach grants persistent, potentially broad access to the S3 bucket, making it impossible to revoke access for individual objects or after a specific time without modifying the IAM user's policy. It creates significant credential management overhead and drastically increases the risk of credential compromise, failing to provide temporary or granular access control.
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 |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.