{

  "AWSTemplateFormatVersion": "2010-09-09",

  "Description": "Weblog",

  "Metadata": {
  },

  "Parameters": {
  },

  "Mappings": {
  },

  "Conditions": {
  },

  "Resources": {

    "Bucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "WebsiteConfiguration": {
          "IndexDocument": "index.html"
        }
      }
    },

    "Distribution": {
      "Type": "AWS::CloudFront::Distribution",
      "Properties": {
        "DistributionConfig": {
          "DefaultCacheBehavior": {
            "ForwardedValues": {
              "QueryString": false
            },
            "TargetOriginId": "diogenes",
            "ViewerProtocolPolicy": "https-only"
          },
          "Enabled": true,
          "Origins": [ {
            "DomainName": { "Ref": "Bucket" },
            "Id": "diogenes",
            "S3OriginConfig": {}
          }],
          "ViewerCertificate": {
            "CloudFrontDefaultCertificate": true
          }
        }
      }
    }

  },

  "Outputs": {
  }

}

{

  "AWSTemplateFormatVersion": "2010-09-09",

  "Description": "Weblog",

  "Metadata": {
  },

  "Parameters": {
  },

  "Mappings": {
  },

  "Conditions": {
  },

  "Resources": {

    "Bucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "WebsiteConfiguration": {
          "IndexDocument": "index.html"
        }
      }
    },

    "Distribution": {
      "Type": "AWS::CloudFront::Distribution",
      "Properties": {
        "DistributionConfig": {
          "DefaultCacheBehavior": {
            "ForwardedValues": {
              "QueryString": false
            },
            "TargetOriginId": "diogenes",
            "ViewerProtocolPolicy": "https-only"
          },
          "Enabled": true,
          "Origins": [ {
            "DomainName": { "Fn::GetAtt": [ "Bucket", "DomainName" ] },
            "Id": "diogenes",
            "S3OriginConfig": {}
          }],
          "ViewerCertificate": {
            "CloudFrontDefaultCertificate": true
          }
        }
      }
    }

  },

  "Outputs": {
  }

}

Set s3 bucket domain name
Set s3 bucket domain name
