Skip to content

Commit abdfb46

Browse files
authored
Enable HTTP 2 and 3 for Cloudfront Distribution (#148)
1 parent 551ce57 commit abdfb46

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cloudformation/main.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ Resources:
678678
Type: AWS::CloudFront::Distribution
679679
Properties:
680680
DistributionConfig:
681+
HttpVersion: 'http2and3'
681682
Origins:
682683
- Id: S3WebsiteOrigin
683684
DomainName: !GetAtt AppFrontendS3Bucket.RegionalDomainName
@@ -699,6 +700,7 @@ Resources:
699700
- UiDomainName
700701

701702
DefaultCacheBehavior:
703+
Compress: true
702704
TargetOriginId: S3WebsiteOrigin
703705
ViewerProtocolPolicy: redirect-to-https
704706
AllowedMethods:
@@ -732,6 +734,7 @@ Resources:
732734
- HEAD
733735
CachePolicyId: !Ref CloudfrontCachePolicy
734736
OriginRequestPolicyId: 216adef6-5c7f-47e4-b989-5492eafa07d3
737+
Compress: true
735738
- PathPattern: "/api/v1/organizations"
736739
TargetOriginId: ApiGatewayOrigin
737740
ViewerProtocolPolicy: redirect-to-https
@@ -748,6 +751,7 @@ Resources:
748751
- HEAD
749752
CachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6"
750753
OriginRequestPolicyId: 216adef6-5c7f-47e4-b989-5492eafa07d3
754+
Compress: true
751755
- PathPattern: "/api/documentation*"
752756
TargetOriginId: ApiGatewayOrigin
753757
ViewerProtocolPolicy: redirect-to-https
@@ -764,6 +768,7 @@ Resources:
764768
- HEAD
765769
CachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6"
766770
OriginRequestPolicyId: 216adef6-5c7f-47e4-b989-5492eafa07d3
771+
Compress: true
767772
- PathPattern: "/api/*"
768773
TargetOriginId: ApiGatewayOrigin
769774
ViewerProtocolPolicy: redirect-to-https
@@ -780,14 +785,14 @@ Resources:
780785
- HEAD
781786
CachePolicyId: 4135ea2d-6df8-44a3-9df3-4b5a84be39ad # caching disabled
782787
OriginRequestPolicyId: 216adef6-5c7f-47e4-b989-5492eafa07d3
788+
Compress: true
783789
ViewerCertificate:
784790
AcmCertificateArn: !FindInMap
785791
- ApiGwConfig
786792
- !Ref RunEnvironment
787793
- EnvCertificateArn
788794
MinimumProtocolVersion: TLSv1.2_2021
789795
SslSupportMethod: sni-only
790-
HttpVersion: http2
791796
PriceClass: PriceClass_100
792797

793798
AppFrontendS3BucketPolicy:
@@ -860,6 +865,7 @@ Resources:
860865
Type: AWS::CloudFront::Distribution
861866
Properties:
862867
DistributionConfig:
868+
HttpVersion: 'http2and3'
863869
Origins:
864870
- Id: ApiGatewayOrigin
865871
DomainName: !Sub "${AppApiGateway}.execute-api.${AWS::Region}.amazonaws.com"
@@ -878,6 +884,7 @@ Resources:
878884
- !Ref RunEnvironment
879885
- EnvDomainName
880886
DefaultCacheBehavior:
887+
Compress: true
881888
TargetOriginId: ApiGatewayOrigin
882889
ViewerProtocolPolicy: redirect-to-https
883890
AllowedMethods:
@@ -904,7 +911,6 @@ Resources:
904911
- EnvCertificateArn
905912
MinimumProtocolVersion: TLSv1.2_2021
906913
SslSupportMethod: sni-only
907-
HttpVersion: http2
908914
PriceClass: PriceClass_100
909915

910916
LinkryRecordsCloudfrontStore:
@@ -962,6 +968,7 @@ Resources:
962968
Type: AWS::CloudFront::Distribution
963969
Properties:
964970
DistributionConfig:
971+
HttpVersion: 'http2and3'
965972
Enabled: true
966973
DefaultCacheBehavior:
967974
ViewerProtocolPolicy: redirect-to-https
@@ -993,7 +1000,6 @@ Resources:
9931000
- EnvCertificateArn
9941001
MinimumProtocolVersion: TLSv1.2_2021
9951002
SslSupportMethod: sni-only
996-
HttpVersion: http2
9971003
PriceClass: PriceClass_100
9981004

9991005
LinkryDomainProxy:

0 commit comments

Comments
 (0)