DOP-C02 Practice Question 65: VPC Endpoint Policy Org ID
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 7 · question 5 of 10
A company runs workloads in a VPC that reaches Amazon S3 only through a gateway VPC endpoint. The security team wants to build a data perimeter so that principals in the VPC can read or write only S3 buckets that belong to the company's own AWS Organization, blocking access to any bucket owned by an outside account even if a compromised credential has a permissive identity policy. Which VPC endpoint policy condition enforces this requirement?
Show answer and explanation
Answer:
A resource perimeter is built by denying access through the endpoint unless the target resource belongs to the company's organization, which is exactly what aws:ResourceOrgID checks: it evaluates the organization ID of the resource being accessed (the S3 bucket), regardless of which identity policy the calling principal holds. Because the statement is a Deny with a StringNotEquals-style condition on the endpoint policy, it blocks traffic to any external bucket even if the caller's IAM policy would otherwise allow it. Option B is backwards: aws:PrincipalOrgID identifies whether the caller belongs to the organization, not the resource, and an Allow that fires when the condition does not match would grant access to outside principals rather than restrict it. Option C uses aws:SourceVpce on the bucket policy, which is a valid network perimeter technique for restricting which endpoint can reach a specific bucket, but it does not scale to blocking every bucket outside the organization and must be maintained per bucket. Option D scopes access to a single account ID, which would block every other account inside the company's own multi-account organization, not just outside accounts.
Reference: Perimeter overview, Building a data perimeter on AWS