Terraform interview question

How do you set up CloudFront with an S3 origin using Origin Access Control in Terraform?

How you'd do it Asked in DevOps Engineer · Cloud Engineer · Site Reliability Engineer (SRE) interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

Create an aws_cloudfront_origin_access_control, reference it on the CloudFront distribution's origin, and add an S3 bucket policy that allows cloudfront:GetObject from the distribution's ARN. The bucket stays fully private.

Keep reading with a membership

The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.

See plans and free trial Already a member? Sign in

More Terraform questions

← All Terraform questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake