
s3 설정
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "cloudfront.amazonaws.com"
},
"Action": "s3:GetObject",
"Resource": "{s3 arn}/*",
"Condition": {
"StringEquals": {
"AWS:SourceArn": "{클라우드 프론트 Origin access control arn}"
}
}
},
{
"Effect": "Allow",
"Principal": {
"AWS": [
"i am arn 1",
"i am arn 2"
]
},
"Action": [
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "{s3 arn}/*"
}
]
}cloudfront 설정-fe
origin
기본 캐시동작
설정
생성완료후 메뉴탭의 “오류페이지” 로 이동
403, 404 redirect를 index.html로 설정후 저장( 브라우저의 뒤로가기, refresh때문)
cloudfront에서 자동으로 s3에 있는 데이터를 캐시해서 가져오지만 시간이 좀 걸린다.
바로 가져오고 싶을경우 메뉴탭의 “무효화” 생성할것. 경로는 /* 로 하면된다.
cloudfront 설정-be
origin
기본 캐시동작
설정