diff --git a/template-cloudfront.yaml b/template-cloudfront.yaml new file mode 100644 index 0000000..0c60701 --- /dev/null +++ b/template-cloudfront.yaml @@ -0,0 +1,41 @@ +AWSTemplateFormatVersion: '2010-09-09' + +Parameters: + WebsiteBucketName: + Type: String + Description: "The name for the S3 bucket to be used for public website hosting (must be globally unique)" + Default: "naputo-blog-public" + +Resources: + BlogCloudFrontDistribution: + Type: AWS::CloudFront::Distribution + Properties: + DistributionConfig: + Enabled: true + Origins: + - Id: S3WebsiteOrigin + DomainName: !Sub "${WebsiteBucketName}.s3-website-${AWS::Region}.amazonaws.com" + CustomOriginConfig: + HTTPPort: 80 + HTTPSPort: 80 + OriginProtocolPolicy: http-only + DefaultCacheBehavior: + TargetOriginId: S3WebsiteOrigin + ViewerProtocolPolicy: redirect-to-https + AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + ForwardedValues: + QueryString: false + Cookies: + Forward: none + Aliases: + - blog.n-daisuke897.com + ViewerCertificate: + AcmCertificateArn: "arn:aws:acm:us-east-1:692859919890:certificate/4d3e8182-71e0-4ccb-a437-36523f61a6c0" + SslSupportMethod: sni-only + MinimumProtocolVersion: TLSv1.2_2021 + PriceClass: PriceClass_200 \ No newline at end of file