CloudFormation: Create a CloudFront Distribution with a Custom Domain and SSL

Static website hosting on S3 is great. However, I did not find a way how to set up SSL there. Further, I wanted to have multiple urls (e.g. and point to this one bucket without much manual effort. All this can be done with CloudFront (Amazon’s content delivery network). This posts describes how to set up with CloudFormation the following: an S3 bucket, an S3 bucket policy that restricts access to this bucket just to CloudFront, a CloudFront Distribution that points to the S3 bucket, and finally, DNS entries in Route53 that point the real domains to the CloudFront URL.
Read more