S3에 CloudFront 연결기

Category
Tags
Published
Last updated
Last updated November 28, 2025
 
해당 글을 참고했습니다.
 

간단한 S3과 CloudFront의 프리티어, 가격 비교

💡
요금은 서울 리전(ap-northeast-2) 기준입니다
S3
CloudFront
- 프리티어
데이터 아웃바운드
100GB/월
1TB/월
요청
GET: 2만건/월 PUT, COPY, POST, LIST: 2천건/월
HTTP, HTTPS: 1000만건/월
CloudFront 함수 호출
200만건/월
- 가격
데이터 아웃바운드
0.126$/GB (처음 10TB)
0.12$/GB (처음 10TB)
요청
GET, SELECT: 0.035$/10,000요청 PUT, COPY, POST, LIST: 0.045$/10,000요청
HTTP: 0.009$/10,000요청 HTTPS: 0.012$/10,000요청

S3에 CloudFront 연결

CloudFront 배포(distribution) 생성

notion image
OAC를 생성해줍니다. 나머지는 기본 설정으로 진행합니다.

S3 버킷 설정

notion image
객체 소유권을 수정해줍니다.

배포에 S3 버킷정책 설정 추가

CloudFront → 배포 → 배포객체 → 원본 → 원본객체 → 편집
notion image
정책을 복사해줍니다.
{ "Version": "2008-10-17", "Id": "PolicyForCloudFrontPrivateContent", "Statement": [ { "Sid": "AllowCloudFrontServicePrincipal", "Effect": "Allow", "Principal": { "Service": "cloudfront.amazonaws.com" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mc-archieve-bucket/*", "Condition": { "StringEquals": { "AWS:SourceArn": "arn:aws:cloudfront::089236912145:distribution/EU67SONO6VQXK" } } } ] }
S3 → 버킷 → 버킷객체 → 권한 → 버킷 정책 → 편집 에서 추가해줍니다.
💡
일단 설정 안해도 되는 것 같긴 하다 이후 찾아보기

퍼블릭 액세스 차단(버킷 설정) 수정

notion image

완료

이제 생성된 버킷 대신 http://d2sz2ewghgrtxk.cloudfront.net/ 로 파일에 접근이 가능합니다.