-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudfront.yml
29 lines (29 loc) · 1013 Bytes
/
cloudfront.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
AWSTemplateFormatVersion: 2010-09-09
Resources:
DeployBucket:
Type: 'AWS::S3::Bucket'
Properties:
# Technically we don't need the S3 bucket configured
# as a website, but I included it for the sake of completion.
WebsiteConfiguration:
IndexDocument: index.html
Distribution:
Type: 'AWS::CloudFront::Distribution'
Properties:
DistributionConfig:
Origins:
- # Use the DeployBucket as the CDN origin
DomainName: !GetAtt DeployBucket.DomainName
Id: !Ref DeployBucket
S3OriginConfig:
OriginAccessIdentity: ''
DefaultRootObject: index.html
Enabled: true
# Configure the caching behavior for our CDN
DefaultCacheBehavior:
MinTTL: 86400 # 1 day
MaxTTL: 31536000 # 1 year
ForwardedValues:
QueryString: true
TargetOriginId: !Ref DeployBucket
ViewerProtocolPolicy: 'redirect-to-https' # we want to force HTTPS