Courseiva
Network Security, Compliance and GovernancemediumMultiple ChoiceObjective-mapped

ANS-C01 aws:SourceVpce condition key Practice Question

A company is using AWS CloudFormation to deploy a stack that includes an S3 bucket with a bucket policy that restricts access to a specific VPC endpoint. The stack fails to create, and the error indicates that the bucket policy contains an invalid principal. Which condition key should be used to restrict access to a VPC endpoint in the bucket policy?

⚠ Common exam trap

A common mistake is attempting to use a VPC endpoint ARN or ID as a principal in the policy. However, VPC endpoints are not valid principals. The correct method uses the `aws:SourceVpce` condition key.

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

The condition key aws:SourceVpce

To restrict access to a specific VPC endpoint in an S3 bucket policy, you must use the `aws:SourceVpce` condition key in the `Condition` element, not a principal. VPC endpoints cannot be specified as principals in policies. Option A correctly identifies the condition key. Option B (VPC ID) is incorrect because you need the VPC endpoint ID, not the VPC ID. Option C (ARN of the VPC endpoint) is incorrect because ARNs are not used in condition keys for this purpose. Option D (VPC endpoint service) is incorrect because the endpoint service is not used in this condition.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The condition key aws:SourceVpce

    Why this is correct

    Correct. `aws:SourceVpce` is a condition key, not a principal, but it is the standard way to restrict access to a specific VPC endpoint in an S3 bucket policy. The question's phrasing is technically imprecise; the correct method uses this condition key in the Condition element.

  • The VPC ID

    Why it's wrong here

    Incorrect. The VPC ID alone cannot be used to restrict access; you must specify the VPC endpoint ID using the `aws:SourceVpce` condition key.

  • The ARN of the VPC endpoint

    Why it's wrong here

    Incorrect. The ARN of the VPC endpoint is not used as a principal or condition key in S3 bucket policies for this purpose.

  • The VPC endpoint service

    Why it's wrong here

    Incorrect. A VPC endpoint service is not a principal and is not used in S3 bucket policies to restrict access to a specific endpoint.

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

Courseiva writes every ANS-C01 question from scratch — 1,621 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 ANS-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 ANS-C01 exam.