Courseiva
Security and ComplianceeasyMultiple SelectObjective-mapped

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 ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

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 →

How Courseiva writes practice questions · Editorial policy

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.