AWS Certified Developer – Associate (DVA-C02) — Question 323

A developer is creating a publicly accessible enterprise website consisting of only static assets. The developer is hosting the website in Amazon S3 and serving the website to users through an Amazon CloudFront distribution. The users of this application must not be able to access the application content directly from an S3 bucket. All content must be served through the Amazon CloudFront distribution.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

Using Amazon CloudFront Origin Access Control (OAC) is the recommended best practice to restrict access to an Amazon S3 bucket origin so that content can only be accessed through CloudFront. By configuring OAC and updating the S3 bucket policy to allow access to the OAC, direct public access to the S3 bucket is securely blocked. Other options, such as using the S3 website endpoint, require the S3 bucket to remain public, which violates the requirement to block direct bucket access.