AWS Certified Solutions Architect – Associate (SAA-C02) — Question 457

A company is developing a file-sharing application that will use an Amazon S3 bucket for storage. The company wants to serve all the files through an Amazon
CloudFront distribution. The company does not want the files to be accessible through direct navigation to the S3 URL.
What should a solutions architect do to meet these requirements?

Answer options

Correct answer: D

Explanation

Creating an Origin Access Identity (OAI) and associating it with the CloudFront distribution allows CloudFront to securely access S3 bucket contents. By updating the S3 bucket policy to allow read access only to this OAI, direct access to the S3 bucket via its direct URL is blocked. Other options, such as assigning an IAM user to CloudFront or directly setting the distribution ID as a principal in the bucket policy, are not supported methods for restricting S3 access to CloudFront.