@@ -27,11 +27,11 @@ Parameters:
2727 S3BucketRootArn :
2828 Description : Content Bucket locator
2929 Type : String
30- CreateApex :
30+ CreateApex :
3131 Type : String
3232
3333Conditions :
34- CreateApexConfig : !Equals
34+ CreateApexConfig : !Equals
3535 - !Ref CreateApex
3636 - ' yes'
3737
@@ -56,7 +56,7 @@ Resources:
5656 DistributionConfig :
5757 Aliases :
5858 - !Sub ' ${SubDomain}.${DomainName}'
59- - !If [ CreateApexConfig, !Ref DomainName, !Ref 'AWS::NoValue' ]
59+ - !If [CreateApexConfig, !Ref DomainName, !Ref 'AWS::NoValue']
6060 DefaultCacheBehavior :
6161 Compress : true
6262 DefaultTTL : 86400
@@ -87,8 +87,7 @@ Resources:
8787 - DomainName : !Ref 'S3BucketRootName'
8888 Id : !Sub 'S3-${AWS::StackName}-root'
8989 S3OriginConfig :
90- OriginAccessIdentity :
91- !Join ['', ['origin-access-identity/cloudfront/', !Ref CloudFrontOriginAccessIdentity]]
90+ OriginAccessIdentity : !Sub 'origin-access-identity/cloudfront/${CloudFrontOriginAccessIdentity}'
9291 PriceClass : ' PriceClass_All'
9392 ViewerCertificate :
9493 AcmCertificateArn : !Ref 'CertificateArn'
@@ -103,60 +102,60 @@ Resources:
103102 Properties :
104103 CloudFrontOriginAccessIdentityConfig :
105104 Comment : !Sub 'CloudFront OAI for ${SubDomain}.${DomainName}'
106-
105+
107106 Route53RecordSetGroup :
108107 Type : AWS::Route53::RecordSetGroup
109108 Properties :
110109 HostedZoneName : !Sub '${DomainName}.'
111110 RecordSets :
112- - Name : !Sub '${SubDomain}.${DomainName}'
113- Type : ' A'
114- AliasTarget :
115- DNSName : !GetAtt 'CloudFrontDistribution.DomainName'
116- EvaluateTargetHealth : false
117- # The following HosteZoneId is always used for alias records pointing to CF.
118- HostedZoneId : ' Z2FDTNDATAQYW2'
111+ - Name : !Sub '${SubDomain}.${DomainName}'
112+ Type : ' A'
113+ AliasTarget :
114+ DNSName : !GetAtt 'CloudFrontDistribution.DomainName'
115+ EvaluateTargetHealth : false
116+ # The following HosteZoneId is always used for alias records pointing to CF.
117+ HostedZoneId : ' Z2FDTNDATAQYW2'
119118
120119 ApexRoute53RecordSetGroup :
121120 Condition : CreateApexConfig
122121 Type : AWS::Route53::RecordSetGroup
123122 Properties :
124123 HostedZoneName : !Sub '${DomainName}.'
125124 RecordSets :
126- - Name : !Ref 'DomainName'
127- Type : ' A'
128- AliasTarget :
129- DNSName : !GetAtt 'CloudFrontDistribution.DomainName'
130- EvaluateTargetHealth : false
131- # The following HosteZoneId is always used for alias records pointing to CF.
132- HostedZoneId : ' Z2FDTNDATAQYW2'
125+ - Name : !Ref 'DomainName'
126+ Type : ' A'
127+ AliasTarget :
128+ DNSName : !GetAtt 'CloudFrontDistribution.DomainName'
129+ EvaluateTargetHealth : false
130+ # The following HosteZoneId is always used for alias records pointing to CF.
131+ HostedZoneId : ' Z2FDTNDATAQYW2'
133132
134133 ResponseHeadersPolicy :
135- Type : AWS::CloudFront::ResponseHeadersPolicy
136- Properties :
137- ResponseHeadersPolicyConfig :
138- Name : !Sub " ${AWS::StackName}-static-site-security-headers"
139- SecurityHeadersConfig :
140- StrictTransportSecurity :
141- AccessControlMaxAgeSec : 63072000
142- IncludeSubdomains : true
143- Override : true
144- Preload : true
145- ContentSecurityPolicy :
146- ContentSecurityPolicy : " default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'"
147- Override : true
148- ContentTypeOptions :
149- Override : true
150- FrameOptions :
151- FrameOption : DENY
152- Override : true
153- ReferrerPolicy :
154- ReferrerPolicy : " same-origin"
155- Override : true
156- XSSProtection :
157- ModeBlock : true
158- Override : true
159- Protection : true
134+ Type : AWS::CloudFront::ResponseHeadersPolicy
135+ Properties :
136+ ResponseHeadersPolicyConfig :
137+ Name : !Sub ' ${AWS::StackName}-static-site-security-headers'
138+ SecurityHeadersConfig :
139+ StrictTransportSecurity :
140+ AccessControlMaxAgeSec : 63072000
141+ IncludeSubdomains : true
142+ Override : true
143+ Preload : true
144+ ContentSecurityPolicy :
145+ ContentSecurityPolicy : " default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'"
146+ Override : true
147+ ContentTypeOptions :
148+ Override : true
149+ FrameOptions :
150+ FrameOption : DENY
151+ Override : true
152+ ReferrerPolicy :
153+ ReferrerPolicy : ' same-origin'
154+ Override : true
155+ XSSProtection :
156+ ModeBlock : true
157+ Override : true
158+ Protection : true
160159
161160Outputs :
162161 CloudFrontDistribution :
0 commit comments