How To Host S3 Static Website With Custom Route 53 Domain (4 Min) | AWS | Set Alias To S3 Endpoint
Summary
TLDRIn this tutorial, ABI from gokjdb demonstrates how to host a static website using Amazon S3 and Route 53 with a custom domain. The video guides viewers through creating an S3 bucket with the same name as the domain, uploading an index.html file, configuring the bucket for static website hosting, and making the objects public. It also covers setting up a Route 53 record with the custom domain to point to the S3 bucket, ensuring the website is accessible via the custom domain. The video concludes with a reminder to check for the DNS change to sync and a prompt for likes, subscriptions, and notifications.
Takeaways
- π Start by navigating to the S3 service in AWS to create a new bucket with a name that matches your custom domain.
- π Leave the region as US East 1 and enable ACLs, but uncheck 'Block all public access' to make objects public.
- π« Acknowledge the warning about making all objects in the bucket public.
- π After creating the bucket, upload the index.html file which contains the website's content, such as a 'Hello World' message.
- βοΈ Go to the bucket's properties, enable static website hosting, and specify 'index.html' as the index document.
- π If you encounter a '403 Forbidden' error, make the index.html file public using the ACLs.
- π Visit the Route 53 service to manage your custom domain and create a new record.
- π Use the same name for the record as your S3 bucket and select 'Simple Routing' for the record type.
- π Choose 'Alias' for the record type and link it to the S3 website endpoint you created earlier.
- π Select the correct region for the S3 endpoint and ensure the record is linked to it.
- π Wait for the DNS changes to sync and then check your custom domain in a new browser to confirm it's routing to the S3 endpoint.
Q & A
What is the main topic of the video?
-The video is about teaching viewers how to host a static website using Amazon S3 with a custom Route 53 domain in AWS.
What is the first step in creating a static website on S3?
-The first step is to navigate to the S3 service and click on 'create bucket', giving it a name that matches your custom domain.
Why is it important to choose the correct region for the S3 bucket?
-Choosing the correct region ensures that your website's data is stored and served from a location that is geographically close to your audience, which can improve load times.
What does enabling ACLs mean in the context of the S3 bucket?
-Enabling ACLs (Access Control Lists) allows you to control who has access to the bucket and its contents.
Why should you uncheck 'Block all public access' when creating the S3 bucket?
-Unchecking 'Block all public access' is necessary because the video tutorial requires the bucket's objects to be public for the website to be accessible.
What file is uploaded to the S3 bucket to serve as the website's homepage?
-An 'index.html' file is uploaded, which contains the content to be displayed on the homepage of the website.
How do you enable static website hosting for the S3 bucket?
-You navigate to the 'properties' tab of the bucket, scroll down to the 'static website hosting' section, click 'edit', enable static website hosting, and specify the index document name.
What is the purpose of the 'make public using ACL' action on the S3 objects?
-The 'make public using ACL' action is used to grant public access to the objects in the bucket, which is required to resolve the 403 Forbidden error and make the website accessible.
What is the process for creating a record in Route 53 to link the custom domain to the S3 bucket?
-You navigate to the 'hosted zones' in Route 53, select your hosted zone, click 'create record', choose 'simple routing', define the record with the same name as the S3 bucket, set the record type to 'A' or 'Alias', and choose the S3 website endpoint as the Alias target.
Why is it necessary to wait for the Route 53 changes to be 'in sync'?
-Waiting for the changes to be 'in sync' ensures that the DNS propagation is complete and the custom domain is correctly pointing to the S3 bucket before testing the website.
How can you confirm that the custom domain is correctly routing to the S3 endpoint?
-You can confirm this by opening a new browser session and visiting your custom domain to see if it displays the content of the S3 bucket's static website.
Outlines
π Hosting a Static Website on S3 with Custom Domain
ABI from gokjdb introduces viewers to the process of hosting a static website using Amazon Web Services (AWS). The tutorial begins with creating an S3 bucket with a name that matches the custom domain. The bucket is set up in the US East 1 region with ACLs enabled but public access blocked. The video demonstrates uploading an 'index.html' file, which contains a simple 'Hello World' message in H1 tags. The properties of the bucket are then configured for static website hosting, with the index document specified. The tutorial also covers resolving a 403 Forbidden error by making the objects public through ACLs and verifying the website's accessibility.
π Configuring Route 53 for Custom Domain Routing
Continuing the tutorial, the video script explains how to set up a custom domain with Amazon Route 53. This involves navigating to the hosted zones and creating a record that matches the S3 bucket name. The record type is set to A or Alias, and the endpoint is configured as an Alias to the S3 website endpoint. The region is selected as US East 1, and the S3 endpoint is automatically populated. After creating the record, the status is monitored until it changes from 'Pending' to 'In Sync'. The final step is to confirm in a new browser session that the custom domain is correctly routing to the S3 endpoint, completing the setup process.
Mindmap
Keywords
π‘S3
π‘Custom Domain
π‘Route 53
π‘Bucket
π‘ACLs (Access Control Lists)
π‘Static Website Hosting
π‘Index Document
π‘Public Access
π‘Record
π‘Alias
π‘DNS Propagation
Highlights
Introduction to hosting a static website using S3 with a custom Route 53 domain in AWS.
Navigating to the S3 service and creating a new bucket with a name matching the custom domain.
Choosing the correct region and enabling ACLs while configuring the bucket.
Disabling 'Block all public access' and acknowledging the warning about making objects public.
Uploading the index.html file to the S3 bucket for the website.
Setting up the properties for static website hosting and specifying the index document.
Accessing the bucket website endpoint to check the website's initial accessibility.
Troubleshooting the 403 Forbidden error by making the objects public using ACL.
Refreshing the website endpoint to display the 'hello world' message after making objects public.
Moving to Route 53 service to configure the custom domain.
Creating a record in the hosted zone with the same name as the S3 bucket.
Selecting the correct record type and endpoint for the S3 website.
Choosing the appropriate region for the S3 endpoint.
Automatic population of the S3 endpoint in Route 53 and creating the record.
Checking the status of the DNS changes and waiting for them to sync.
Confirming the custom domain routing to the correct S3 endpoint in a new browser session.
Encouraging viewers to like, subscribe, and turn on notifications for future content.
Transcripts
hi guys this is ABI from gokjdb in this
video you're going to learn how to host
a static website using S3 with a custom
Route 53 domain in AWS let's get into it
[Music]
let's start by navigating to the S3
service
then click on create bucket and give it
a name the name of the bucket needs to
be the exact same as the name of your
custom domain so I'm going to pick
testing dot
gokjdb.com let's leave the region to us
East 1 and enable ACLS attention
uncheck block all public access then
acknowledge the warning that says this
will make all objects in this bucket
public I'm going to leave all the other
settings to their default values then
click on create bucket let's go inside
our bucket and upload the
index.html file for our website keep
your formation
in this file well I'm just printing
hello world within H1 tags let's
continue uploading this file by hitting
the upload button
next navigate to the properties tab then
scroll down to the static website
hosting section click edit enable static
website hosting then specify the name of
your index document in our case this
will be
index.html that's why
save then go back to the static website
hosting section
this time you should see a bucket
website endpoint here click on it to see
if you can access your website
[Music]
[Applause]
looks like we're getting the 403
Forbidden error to fix that go to the
objects tab then click on the actions
drop down choose make public using ACL
then hit the make public button refresh
your website endpoint and this time you
should see your hello world message
[Music]
next let's navigate to the Route 53
service then click on hosted zones go
inside your hosted zone for me it's
cocktjdb.com then click on create record
choose simple routing hit next then
click on Define simple record for record
name it needs to be the same as our S3
bucket so in this case it should be
testing Dot gokudb.com
leave the record type to a or Alias and
for endpoint choose Alias 2 S3 website
endpoint company
for region I'm going going to select Us
East 1 and now if you click inside the
S3 endpoint text box our S3 endpoint
that we created earlier should
automatically pop up select it then
click on Define simple record hit create
records then click on view status
your change status should now say
pending give it a few minutes
and it should eventually change to in
sync let's open a new browser session to
confirm that our custom domain is now
routing to the correct S3 endpoint
[Music]
and Below don't forget to like subscribe
and turn on the notification Bell until
next time
ah
Browse More Related Video
AWS Cloud Resume Challenge - Setting up S3 bucket and CloudFront | Part 2
How To: Custom Domain For EC2 Web Server (3 Min) | AWS Route 53 | Using A DNS Record In Hosted Zone
How To: Custom Domain Name In Elastic Beanstalk (2 Min) | AWS | Using Route 53 Routing
My hack to get Webflow hosting for free!
How to Create a FREE Website Using AI | 2024 π
AZ-140 ep02 | Configure Active Directory | Azure AD DNS
5.0 / 5 (0 votes)