Navigation Menu

Skip to content

Commit

Permalink
Added CloudFront invalidation command
Browse files Browse the repository at this point in the history
  • Loading branch information
schlarpc committed Jul 17, 2017
1 parent d5cf8ab commit 4784b71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions deploy-template.sh
Expand Up @@ -22,3 +22,6 @@ if [ "$INITIAL_DEPLOY" = "true" ]; then
FRONTEND_BUCKET=$(./get-output.sh FrontendBucketName)
aws s3 sync ./frontend s3://$FRONTEND_BUCKET/$FRONTEND_PATH
fi

aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id $(./get-output.sh FrontendDistributionId) --paths '/*'
6 changes: 4 additions & 2 deletions template.yaml
Expand Up @@ -46,7 +46,7 @@ Resources:
HttpVersion: http2
Origins:
- DomainName: !Select [2, !Split ["/", !GetAtt FrontendS3Bucket.WebsiteURL]]
Id: !Ref FrontendOriginPath
Id: S3Bucket
OriginPath: !Join
- ''
- - /
Expand All @@ -60,7 +60,7 @@ Resources:
MinTTL: 0
DefaultTTL: 2592000
MaxTTL: 2592000
TargetOriginId: !Ref FrontendOriginPath
TargetOriginId: S3Bucket
ViewerProtocolPolicy: redirect-to-https
ForwardedValues:
QueryString: 'false'
Expand All @@ -78,6 +78,8 @@ Outputs:
- !Ref ServerlessRestApiProdStage
FrontendBucketName:
Value: !Ref FrontendS3Bucket
FrontendDistributionId:
Value: !Ref FrontendCloudFrontDistribution
FrontendUrl:
Value: !Join
- ''
Expand Down

0 comments on commit 4784b71

Please sign in to comment.