How to use amazon s3 and cloudfront to host image
Opened this issue · 0 comments
mylamour commented
- create a s3 bucket
- enable server side encryption
- setting accees only with cloudfront ( you can do it when cloudfront was created)
{
"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
{
"Sid": "AllowCloudFrontServicePrincipal",
"Effect": "Allow",
"Principal": {
"Service": "cloudfront.amazonaws.com"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your bucketname/*",
"Condition": {
"StringEquals": {
"AWS:SourceArn": "replace with your arn"
}
}
}
]
}
- create folder named
images
andassets
(this step was optional)
-
create cloudfront instance wth s3 backend and domain binding with origin access control
- please set
https
only