In this recipe, we will add a custom domain name to a CloudFront distribution. Without CloudFront, S3 bucket names have to be the same as the domain names. To demonstrate this, we will use a domain name, qname.net, to point to the CloudFront domain that is represented by the bucket qname.com.
Using custom domain names with CloudFront
Getting ready
You will need an S3 bucket configured as a website. You can follow the recipe Setting up an S3 static website to set up an S3 bucket as a static website.
How to do it...
I will create a CloudFront distribution for the S3 bucket...