Back to basics — Professional CV with S3

Fernando Pereiro
Fernando Pereiro
Published in
3 min readJan 26, 2018

One of the most basic and useful actions we can take on AWS is hosting a website.

You can host a static website on Amazon Simple Storage Service (Amazon S3). On a static website, individual webpages include static content and also client-side scripts.

In this particular case I will upload a personal web page (HTML + JS) to a S3 bucket and link it to a specific domain using Route 53.

First we need to go to the S3 console and click on “Create bucket”.

Then we type a bucket name and select a region. Remember! the bucket name must be unique across all AWS!

One more thing: If you are going to use your S3 endpoint to link it with a domain in Route 53 yo need to match your bucket name with your domain.

As we are serving content to the Internet, we need to set the bucket as “Public”.

Just let’s finish the wizard, select the new bucket in the S3 console and upload the website files.

Once Uploaded, select the files and make them “Public”.

Go to the “Properties” tab and enable the static website hosting writing your index document and saving the changes.

You can now test your site clicking on the Endpoint URL.

Now we are going to use a domain registered with Route 53, if you don’t have one you can check and buy it in the Route 53 console.

After you register a domain, Route 53 will create for you a Hosted Zone and two Record Sets, in addition we will create a new Record Set with Alias type and we will use the generic S3 Endpoint for the region where we created the bucket before.

for a list of AWS Region-specific website endpoints for Amazon S3, see Website Endpoints.

It’s done! Now the website is available using a specific domain.

Extra tip!! If you want to add subdomains to your new static website you just need to repeat the previous steps; for example, if you want to do a sub.domain.com, just create a new bucket with that name and a new Record Set in the Route 53 console.

And… if you want to be able to access to your website from domain.com and www. domain.com create a new empty bucket with redirection activated: “Redirect request” in the “Static website hosting” box of “Properties” tab inside the S3 console, together with a new Record Set too.

--

--

Fernando Pereiro
Fernando Pereiro

Highly experienced DevOps and Cloud Solutions Architect.