DEA-C01 aws:PrincipalTag Practice Question
A data engineer wants to ensure that only users with a specific tag (e.g., "Department": "DataEngineering") can access an S3 bucket. How can this be enforced?
⚠ Common exam trap
Be careful not to confuse principal tags with resource tags. The condition 'aws:PrincipalTag' checks the requester's IAM user/role tags, while 's3:ExistingObjectTag' checks tags on the S3 object itself. This question tests the distinction.
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
✓
Use a bucket policy with aws:PrincipalTag condition
S3 bucket policies support condition keys like aws:PrincipalTag, which allow access control based on tags attached to IAM principals (users or roles). Option A is correct because it uses aws:PrincipalTag in the bucket policy to restrict access to users with the specific tag. Option B is incorrect because S3 object tags are for objects, not principals, and cannot be used to filter users. Option C is incorrect because attaching an IAM policy to each user is less scalable and does not leverage the bucket policy's centralized control. Option D is incorrect because S3 Object Lambda is for modifying data during retrieval, not for access control decisions.
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 a bucket policy with aws:PrincipalTag condition
Why this is correct
A bucket policy with the `aws:PrincipalTag` condition key evaluates the tag attached to the calling principal's identity, so only users tagged `Department: DataEngineering` satisfy the condition and gain access. This directly enforces the stem's tag-based restriction at the resource, without relying on group membership or role naming.
- ✗
Use S3 object tags and a bucket policy condition
Why it's wrong here
S3 object tags describe individual objects, not the requesting principal, so a bucket policy condition on them cannot evaluate the user's Department tag. IAM principal tags with aws:PrincipalTag are required; object tags suit per-object access control, not user-attribute enforcement.
- ✗
Attach an IAM policy to each user with the tag
Why it's wrong here
This is incorrect in the context of the question, which asks for enforcing access via an S3 bucket policy. While attaching an IAM policy per user can work, it is not the approach described (it would require managing individual policies). The bucket policy is more centralized.
- ✗
Use S3 Object Lambda to check user tags
Why it's wrong here
S3 Object Lambda transforms object data during retrieval; it cannot evaluate the caller's IAM tags to authorise or deny access. Principal-tag conditions in an IAM or bucket policy are needed. Object Lambda suits on-the-fly redaction or format conversion, not tag-based authorisation.
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 1,321 original DEA-C01 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 DEA-C01 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 DEA-C01 exam.