AWSTemplateFormatVersion: "2010-09-09" Description: "The 7th Saga static site" Resources: 7thSagaSiteBucket: Type: "AWS::S3::Bucket" Properties: BucketName: "7thsaga.tmont.com" PublicAccessBlockConfiguration: BlockPublicAcls: false BlockPublicPolicy: false IgnorePublicAcls: false RestrictPublicBuckets: false DeletionPolicy: Retain 7thSagaSiteCachePolicy: Type: "AWS::CloudFront::CachePolicy" Properties: CachePolicyConfig: Comment: "Cache policy for 7thsaga.tmont.com distribution" DefaultTTL: 300 # five minutes MaxTTL: 31536000 MinTTL: 60 Name: "7thsaga-cache-policy" ParametersInCacheKeyAndForwardedToOrigin: CookiesConfig: CookieBehavior: none EnableAcceptEncodingBrotli: true EnableAcceptEncodingGzip: true HeadersConfig: HeaderBehavior: none QueryStringsConfig: QueryStringBehavior: none # 7thSagaSiteDistribution: Type: "AWS::CloudFront::Distribution" Properties: DistributionConfig: Aliases: - 7thsaga.tmont.com Comment: "Frontend proxy for 7thsaga.tmont.com" DefaultCacheBehavior: AllowedMethods: - GET - HEAD CachedMethods: - GET - HEAD CachePolicyId: !Ref 7thSagaSiteCachePolicy Compress: true TargetOriginId: s3-7thsaga-bucket ViewerProtocolPolicy: "redirect-to-https" DefaultRootObject: "index.html" Enabled: true HttpVersion: http2 IPV6Enabled: true Origins: - DomainName: !GetAtt 7thSagaSiteBucket.RegionalDomainName Id: s3-7thsaga-bucket S3OriginConfig: OriginAccessIdentity: "" ViewerCertificate: AcmCertificateArn: "arn:aws:acm:us-east-1:592283802202:certificate/047c0748-04a5-49bd-ab5e-208935428a02" MinimumProtocolVersion: "TLSv1" SslSupportMethod: "sni-only" Tags: - Key: app Value: 7thsaga 7thSagaSiteDNS: Type: "AWS::Route53::RecordSetGroup" Properties: Comment: "DNS for 7thsaga.tmont.com CloudFront proxy" HostedZoneName: "tmont.com." RecordSets: - Name: 7thsaga.tmont.com Type: "A" AliasTarget: # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-aliastarget.html#cfn-route53-aliastarget-hostedzoneid HostedZoneId: "Z2FDTNDATAQYW2" DNSName: !GetAtt 7thSagaSiteDistribution.DomainName - Name: 7thsaga.tmont.com Type: "AAAA" AliasTarget: HostedZoneId: "Z2FDTNDATAQYW2" DNSName: !GetAtt 7thSagaSiteDistribution.DomainName