@@ -123,7 +123,7 @@ Resources:
123123        GWApiId : !Ref AppApiGateway 
124124        GWHostedZoneId :
125125          !FindInMap [ApiGwConfig, !Ref RunEnvironment, HostedZoneId] 
126-         CloudfrontDomain : !GetAtt [AppFrontendCloudfrontDistribution , DomainName] 
126+         CloudfrontDomain : !GetAtt [AppIcalCloudfrontDistribution , DomainName] 
127127
128128  LinkryDomainProxy :
129129    Type : AWS::Serverless::Application 
@@ -143,7 +143,7 @@ Resources:
143143        GWApiId : !Ref AppApiGateway 
144144        GWHostedZoneId :
145145          !FindInMap [ApiGwConfig, !Ref RunEnvironment, HostedZoneId] 
146-         CloudfrontDomain : !GetAtt [AppFrontendCloudfrontDistribution , DomainName] 
146+         CloudfrontDomain : !GetAtt [AppIcalCloudfrontDistribution , DomainName] 
147147
148148  CoreUrlProd :
149149    Type : AWS::Serverless::Application 
@@ -626,20 +626,6 @@ Resources:
626626            - ApiGwConfig 
627627            - !Ref  RunEnvironment 
628628            - UiDomainName 
629-           - !Join 
630-             - " " 
631-             - - "go." 
632-               - !FindInMap 
633-                 - ApiGwConfig 
634-                 - !Ref  RunEnvironment 
635-                 - EnvDomainName 
636-           - !Join 
637-             - " " 
638-             - - "ical." 
639-               - !FindInMap 
640-                 - ApiGwConfig 
641-                 - !Ref  RunEnvironment 
642-                 - EnvDomainName 
643629
644630        DefaultCacheBehavior :
645631          TargetOriginId : S3WebsiteOrigin 
@@ -767,23 +753,95 @@ Resources:
767753    Properties :
768754      FunctionName : !Ref AppFrontendEdgeLambda 
769755
756+   AppIcalCloudfrontDistribution :
757+     Type : AWS::CloudFront::Distribution 
758+     Properties :
759+       DistributionConfig :
760+         Origins :
761+           - Id : ApiGatewayOrigin 
762+             DomainName : !Sub "${AppApiGateway}.execute-api.${AWS::Region}.amazonaws.com" 
763+             OriginPath : " /default" 
764+             CustomOriginConfig :
765+               HTTPPort : 80 
766+               HTTPSPort : 443 
767+               OriginProtocolPolicy : https-only 
768+         Enabled : true 
769+         Aliases :
770+           - !Join 
771+             - " " 
772+             - - "go." 
773+               - !FindInMap 
774+                 - ApiGwConfig 
775+                 - !Ref  RunEnvironment 
776+                 - EnvDomainName 
777+           - !Join 
778+             - " " 
779+             - - "ical." 
780+               - !FindInMap 
781+                 - ApiGwConfig 
782+                 - !Ref  RunEnvironment 
783+                 - EnvDomainName 
784+         DefaultCacheBehavior :
785+           TargetOriginId : ApiGatewayOrigin 
786+           ViewerProtocolPolicy : redirect-to-https 
787+           AllowedMethods :
788+             - GET 
789+             - HEAD 
790+             - OPTIONS 
791+             - PUT 
792+             - POST 
793+             - DELETE 
794+             - PATCH 
795+           CachedMethods :
796+             - GET 
797+             - HEAD 
798+           ForwardedValues :
799+             QueryString : false 
800+             Cookies :
801+               Forward : none 
802+           CachePolicyId : !Ref CloudfrontCachePolicy 
803+           OriginRequestPolicyId : 216adef6-5c7f-47e4-b989-5492eafa07d3 
804+         ViewerCertificate :
805+           AcmCertificateArn : !FindInMap 
806+             - ApiGwConfig 
807+             - !Ref  RunEnvironment 
808+             - EnvCertificateArn 
809+           MinimumProtocolVersion : TLSv1.2_2021 
810+           SslSupportMethod : sni-only 
811+         HttpVersion : http2 
812+         PriceClass : PriceClass_100 
813+ 
814+ 
770815Outputs :
771816  DomainName :
772817    Description : Domain name that the UI is hosted at 
773818    Value : !FindInMap 
774819      - ApiGwConfig 
775820      - !Ref  RunEnvironment 
776821      - UiDomainName 
822+ 
777823  CloudfrontCnameTarget :
778824    Description : CNAME record target to create for the domain name above (create the CNAME manually) 
779825    Value :
780826      Fn::GetAtt :
781827        - AppFrontendCloudfrontDistribution 
782828        - DomainName 
829+ 
830+   CloudfrontSecondaryCnameTarget :
831+     Description : CNAME record target to create for the secondary domain names (create the CNAME manually) 
832+     Value :
833+       Fn::GetAtt :
834+         - AppIcalCloudfrontDistribution 
835+         - DomainName 
836+ 
783837  CloudfrontDistributionId :
784838    Description : Cloudfront Distribution ID 
785839    Value : !GetAtt AppFrontendCloudfrontDistribution.Id 
786840
841+   CloudfrontSecondaryDistributionId :
842+     Description : Cloudfront Distribution ID 
843+     Value : !GetAtt AppIcalCloudfrontDistribution.Id 
844+ 
787845  SalesEmailQueueArn :
788846    Description : Sales Email Queue Arn 
789847    Value : !GetAtt AppSQSQueues.Outputs.SalesEmailQueueArn 
0 commit comments