Skip to content

Instantly share code, notes, and snippets.

@tomfa
Created December 20, 2015 19:09
Show Gist options
  • Save tomfa/889a0bca08e59f6bbfa9 to your computer and use it in GitHub Desktop.
Save tomfa/889a0bca08e59f6bbfa9 to your computer and use it in GitHub Desktop.
Cloudfront config for use with awscli (suitable for staticfiles for websites - stored in a S3 bucket). Replace "[[YOUR-BUCKET-NAME]]"
{
"DistributionConfig": {
"Comment": "",
"CacheBehaviors": {
"Quantity": 0
},
"Logging": {
"Bucket": "",
"Prefix": "",
"Enabled": false,
"IncludeCookies": false
},
"WebACLId": "",
"Origins": {
"Items": [
{
"OriginPath": "",
"S3OriginConfig": {
"OriginAccessIdentity": ""
},
"Id": "S3-[[YOUR-BUCKET-NAME]]",
"DomainName": "[[YOUR-BUCKET-NAME]].s3.amazonaws.com"
}
],
"Quantity": 1
},
"DefaultRootObject": "",
"PriceClass": "PriceClass_All",
"Enabled": true,
"DefaultCacheBehavior": {
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TargetOriginId": "S3-[[YOUR-BUCKET-NAME]]",
"ViewerProtocolPolicy": "allow-all",
"ForwardedValues": {
"Headers": {
"Items": [
"Access-Control-Request-Headers",
"Origin"
],
"Quantity": 2
},
"Cookies": {
"Forward": "none"
},
"QueryString": true
},
"MaxTTL": 31536000,
"SmoothStreaming": false,
"DefaultTTL": 86400,
"AllowedMethods": {
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Items": [
"HEAD",
"GET"
],
"Quantity": 2
},
"Quantity": 2
},
"MinTTL": 0
},
"CallerReference": "",
"ViewerCertificate": {
"CloudFrontDefaultCertificate": true,
"MinimumProtocolVersion": "SSLv3"
},
"CustomErrorResponses": {
"Quantity": 0
},
"Restrictions": {
"GeoRestriction": {
"RestrictionType": "none",
"Quantity": 0
}
},
"Aliases": {
"Quantity": 0
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment