Configuring Amazon S3 Buckets to Host a Static Website with a Custom Domain

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this live AWS environment, we will create and configure a simple static website. Then, we will configure that static website with a custom domain, using Route 53 Alias record sets. This lab demonstrates how to create cost-efficient website hosting for sites that consist of files like HTML, CSS, JavaScript, fonts, and images.

The code we use for the static site is [here](https://github.com/ACloudGuru-Resources/aws-s3-route53-static-website/tree/main).

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an S3 Bucket and a Static Website

Create an S3 bucket for our assigned domain, configure a static website for the domain, and set up a DNS record (called an A or alias record) in Route 53. Make sure that in the Object Ownership section, check ACLs enabled.

Configure a Custom Domain in Route 53

Create a redirect (www) S3 bucket and configure a redirect DNS record to point to our AWS S3 static site.

Test the Static Website with `dig` and `nslookup` Commands

Open our instant terminal and run the dig and nslookup commands to verify our website is routed properly.

Additional Resources

Log in to the AWS environment using the credentials provided. Make sure you're in the us-east-1 (N. Virginia) region throughout the lab.

Note: When creating the S3 bucket, make sure that in the Object Ownership section, check ACLs enabled.

The code we use for the static site is here.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?