A VPC contains multiple VPC endpoints for Amazon S3. A developer needs an S3 bucket policy that ensures access to the bucket is allowed only when requests come through those VPC endpoints. Which solution satisfies this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Create one S3 bucket policy that lists all VPC endpoint IDs in the aws:SourceVpce condition (using StringNotEquals) to cover each endpoint..
Why this is the answer
The correct solution is to create one S3 bucket policy that lists all VPC endpoint IDs in the aws:SourceVpce condition using StringNotEquals. This ensures that access is explicitly denied unless the request originates from one of the specified VPC endpoints. The aws:SourceVpce condition key checks the specific VPC endpoint ID. Incorrect options: Creating multiple S3 bucket policies, each with a single VPC endpoint ID, would not work as S3 evaluates all policies, and a single allow would grant access. Using aws:SourceVpc with StringNotEquals and the VPC ID would restrict access to the entire VPC, but it wouldn't guarantee that the request came through a VPC endpoint, as direct internet access from within the VPC might still be possible if not otherwise restricted. Using a wildcard like vpce with aws:SourceVpce is not supported for this condition key and would not correctly identify the specific endpoints.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed