Created
December 13, 2022 09:20
-
-
Save mjzone/8297724ebdcf79c4e70a7f27025dc1fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Cache policy | |
RestAPICachePolicy: | |
Type: AWS::CloudFront::CachePolicy | |
Properties: | |
CachePolicyConfig: | |
DefaultTTL: 300 | |
MaxTTL: 31536000 | |
MinTTL: 60 | |
Name: RestAPICachePolicy | |
ParametersInCacheKeyAndForwardedToOrigin: | |
CookiesConfig: | |
CookieBehavior: none | |
EnableAcceptEncodingBrotli: true | |
EnableAcceptEncodingGzip: true | |
HeadersConfig: | |
HeaderBehavior: whitelist | |
Headers: | |
- Authorization | |
QueryStringsConfig: | |
QueryStringBehavior: none | |
#Cloudfront distribution | |
CloudFrontDistribution: | |
Type: AWS::CloudFront::Distribution | |
Properties: | |
DistributionConfig: | |
Enabled: true | |
DefaultCacheBehavior: | |
TargetOriginId: myRestAPIOrigin01 | |
CachePolicyId: !Ref RestAPICachePolicy | |
ViewerProtocolPolicy: https-only | |
CacheBehaviors: | |
- PathPattern: /dev/* | |
TargetOriginId: myRestAPIOrigin01 | |
CachePolicyId: !Ref RestAPICachePolicy | |
ViewerProtocolPolicy: https-only | |
Origins: | |
- Id: myRestAPIOrigin01 | |
DomainName: abcd.execute-api.us-east-1.amazonaws.com | |
CustomOriginConfig: | |
OriginProtocolPolicy: https-only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment