We can add a CloudFront distribution to an S3 bucket with a custom domain and ACM certificate as follows:
- Follow steps 1 to 5 of the CloudFront distribution with a CloudFront default domain section of this recipe.
- Under Distribution Settings, for Alternate Domain Names (CNAMEs), enter *.heartin.cloud. For SSL Certificate, select Custom SSL Certificate (example.com) and select the ACM certificate we created in the Getting ready section:
- For the Default Root Object, enter index.html. For the other options, use their defaults and click Create Distribution. Click on Distributions ...