
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
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?
A
Write individual policies for each S3 bucket to grant read permission for only CloudFront access.
B
Create an IAM user. Grant the user read permission to objects in the S3 bucket. Assign the user to CloudFront.
C
Write an S3 bucket policy that assigns the CloudFront distribution ID as the Principal and assigns the target S3 bucket as the Amazon Resource Name (ARN).
D
Create an origin access identity (OAI). Assign the OAI to the CloudFront distribution. Configure the S3 bucket permissions so that only the OAI has read permission.
Explanation:
The correct answer is D because:
Origin Access Identity (OAI) is specifically designed for this use case - to restrict direct access to S3 objects while allowing CloudFront to serve them.
How OAI works:
Why other options are incorrect:
Best Practice: Using OAI is the AWS-recommended approach for securing S3 origins behind CloudFront distributions. It ensures that content can only be accessed through CloudFront URLs, not directly via S3 URLs.
Implementation Steps:
s3:GetObject permission to the OAI