Slide 8
Slide 8 text
bucket-policy.json
{
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS":
"arn:aws:iam::cloudfront:user/CloudFront Origin
Access Identity [OAI_ID]"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::[BUCKET_NAME]/*"
},
{
"Effect": "Allow",
"Principal": {
"AWS":
"arn:aws:iam::cloudfront:user/CloudFront Origin
Access Identity [OAI_ID]"
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::[BUCKET_NAME]"
}
]
}
distribution.json
{
"Comment": "",
"Origins": {
"Items": [
{
"S3OriginConfig": {
"OriginAccessIdentity":
"origin-access-identity/cloudfront/[OAI_ID]"
},
"Id": "origin",
"DomainName": "[BUCKET_NAME].s3.amazonaws.com"
}
],
"Quantity": 1
},
"DefaultRootObject": "index.html",
"PriceClass": "PriceClass_All",
"Enabled": true,
"DefaultCacheBehavior": {
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TargetOriginId": "origin",
"ViewerProtocolPolicy": "allow-all",
"ForwardedValues": {
"Cookies": {
"Forward": "none"
},
"QueryString": false
},
"MinTTL": 0,
"Compress": true
},
"CallerReference": "distribution-[BUCKET_NAME]",
"CustomErrorResponses": {
"Items": [
{
"ErrorCode": 404,
"ResponsePagePath": "/index.html",
"ResponseCode": "200"
}
],
"Quantity": 1
}
}