SOA-C02 Security and Compliance Practice Question
A company wants to ensure that their Amazon S3 bucket policy only allows access from a specific VPC endpoint. Which TWO condition keys can be used in the bucket policy? (Choose TWO.)
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:SourceVpc
The correct condition keys are 'aws:SourceVpc' (option C) and 'aws:SourceVpce' (option E). 'aws:SourceVpc' restricts access to all VPC endpoints within a specified VPC, while 'aws:SourceVpce' restricts access to a specific VPC endpoint. Option A 's3:SourceVpce' is not a valid condition key. Option B 'aws:SourceIp' is used for IP address restrictions, not VPC endpoints. Option D 'ec2:Vpc' is not applicable in S3 bucket policies.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
s3:SourceVpce
Why it's wrong here
s3:SourceVpce is not a recognized condition key; the correct prefix for VPC endpoint conditions is aws:SourceVpce, not s3:. S3-specific condition keys use the s3: prefix (e.g., s3:prefix, s3:max-keys), but SourceVpce is not among them, so this option is invalid and would cause a policy error if used.
- ✗
aws:SourceIp
Why it's wrong here
aws:SourceIp restricts based on the source IP address, but it cannot guarantee that a request originates from a particular VPC because VPC traffic can traverse public IPs or NAT gateways. This condition key is useful for IP-based access control, but it does not validate the VPC context, so it fails to meet the requirement of restricting to a specific VPC.
- ✓
aws:SourceVpc
Why this is correct
aws:SourceVpc is the correct condition key because it allows S3 bucket policies to restrict access to requests originating from a specific VPC by using the VPC ID (e.g., vpc-0abc123). It ensures that only EC2 instances, Lambda functions, or other resources within that VPC can access the bucket, without needing to know the individual IP addresses.
- ✗
ec2:Vpc
Why it's wrong here
ec2:Vpc is not a valid condition key in S3 bucket policies; S3 only recognizes a limited set of condition keys, including those prefixed with s3: and AWS-wide keys like aws:SourceVpc. The ec2 namespace is reserved for EC2-specific conditions, but ec2:Vpc is not a defined key, and even if it were, S3 bucket policies would not evaluate it.
- ✓
aws:SourceVpce
Why this is correct
aws:SourceVpce is a valid condition key that restricts access to requests that arrive through a specific VPC endpoint (e.g., vpce-0abc123). It provides finer-grained control than aws:SourceVpc because it can limit access to a single gateway endpoint or interface endpoint, rather than the entire VPC, which is useful for enforcing tighter security boundaries.
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
This SOA-C02 question is part of Courseiva's 247-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SOA-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 SOA-C02 exam.