You want blog.example.com to serve a fast static website from AWS without babysitting a server. That is noble and slightly lazy in the best way. This guide covers the DNS and hosting bits with Route 53, S3, CloudFront and ACM so your site is public when it should be and secure when you want to impress people.
Create a public S3 bucket that exactly matches the subdomain you plan to use. For example use blog.example.com as the bucket name for virtual hosted style addressing. If the names do not match AWS will side eye you and your DNS will be unhappy.
In the bucket properties turn on static website hosting and set your index and error documents such as index.html and 404.html. Upload your HTML CSS and asset files. Remember that S3 website endpoints are region specific so note the endpoint for the region you used when creating the bucket.
To serve the files directly from S3 either disable block public access for that bucket or attach a bucket policy that grants s3 GetObject to the public. If public hosting makes you nervous put CloudFront in front of the bucket for TLS and add an ACM certificate for the domain to the CloudFront distribution. Pro tip ACM certificates for CloudFront must be requested in the us-east-1 region.
Use the hosted zone for example.com in Route 53 and add an alias A record for the subdomain that points to the S3 website endpoint if you are serving directly from S3. If you are using CloudFront create an alias record that targets the distribution. If your domain registrar is not AWS make sure to update name servers at the registrar to the ones from the hosted zone so DNS actually works instead of pretending to.
That is the whole show. You now know how to map a subdomain using Route 53 DNS to an S3 static website and when to throw CloudFront and ACM at the problem for HTTPS. It is straightforward once you survive the AWS console maze and a few polite error messages.
Keywords to remember while you brag about your new site AWS Route 53 S3 subdomain DNS static website domain mapping CloudFront hosting ACM
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.