00:00Hey everyone, this is Lucy and in this video we're going to be building one of my favourite AWS cloud
00:05projects.
00:06This is a very simple AWS project for absolute beginners and only takes around 15 minutes to build.
00:11A lot of you really enjoyed my recent video on the top AWS projects for beginners
00:15and wanted to know what other projects you can build on AWS.
00:18So here's what I'm thinking and let me know your thoughts in the comments below.
00:22I want to start a monthly build with me series where every month I walk you through step by step
00:27how to build an AWS cloud project.
00:29I want to make sure these projects are very simple and beginner friendly so that it doesn't take you days
00:34and weeks to complete.
00:35In fact, by the end of each video, if you decide to follow along, you want to build a cool
00:39cloud project that combines a few AWS services.
00:42If you like the idea, comment below with the phrase let's build together just so I know whether I should
00:46make more videos like this.
00:48So for today's project, we'll be launching a static website using two AWS services, Amazon S3 and Amazon Route 53.
00:55We'll start off by creating a custom domain name using Route 53, then we'll use an Amazon S3 bucket to
01:01host a sample website.
01:02And finally, we'll enable static website hosting, connect it to the domain name and view our website.
01:08Okay, let's jump straight into it and open up the AWS console.
01:11By the way, I'd highly recommend you follow along in real time and pause the video when you need.
01:16So the first step is to head to the Amazon Route 53 dashboard.
01:19We're going to start off by purchasing a domain name.
01:22For example, if I click on registered domains, you can see here that I've already registered techwithlucy.click.
01:29Let me show you how you can register your own domain name.
01:32If you click on register domain, you can type in a domain name you'd like.
01:36For example, lucyproject.click.
01:41And the reason I'm choosing .click is because it's the cheapest one I can find.
01:45Check if it's available and add it to your cart.
01:49And fill in your contact details.
01:51After I type in my details, the final stage is to accept the terms and conditions.
01:56When you're on this page, make sure you click disable when asked if you want to automatically renew your domain.
02:01That way, you won't be charged after one year once your domain expires.
02:05Accept the terms and conditions and complete order.
02:08Okay, so here it says that the domain registration might take up to three days to complete.
02:13But usually, it only takes around 10 minutes for me.
02:15So, while we're waiting for the domain registration to be completed, I'd like to take a moment to tell you
02:20about today's video sponsor, Brilliant.
02:22One of the best ways to understand technical concepts is by going back to the fundamentals.
02:27Brilliant is a learning platform with hands-on courses in maths, science and computer science.
02:31The lessons are very interactive and you'll be guided through fun problems that come with detailed solutions.
02:36If you're someone looking to start your career in the cloud industry and want to improve your programming skills, you
02:42can check out their Programming with Python course.
02:44You can get started with Brilliant for free by heading to brilliant.org forward slash techwithlucy and the first 200
02:49people will also get 20% off their annual membership.
02:52Now, let's get back to the video.
02:54So, once your domain has been registered, you can then head to the next step.
02:58And the next step is to go to the Amazon S3 page and create a bucket.
03:05So, this bucket will be used to host our website.
03:08So, once you click on Create Bucket, type in the domain name that you registered, techwithlucy.click.
03:17So, for this to work, make sure you use the same name as the domain you registered.
03:21For the region, you can select a region that is closest to where you live in order to make sure
03:27that you can reduce latency.
03:29So, in my case, I live in Sydney, so I'm going to select the AP Southeast 2 region.
03:34Scroll down to the bottom and uncheck this Block Public Access.
03:39This is to make sure that the users will have access to your bucket and make sure it's publicly accessible
03:46to others on the internet.
03:48Acknowledge this warning and keep all the other settings as default.
03:54So, once the bucket has been created, you can see here there's techwithlucy.click as a bucket.
03:59Click into your own bucket and select Upload.
04:04So, what we're going to do is we're going to upload our website.
04:07And for this demo, I've decided to keep it very simple and just have a single page as the website.
04:14So, I'm going to upload the content on my website, which is this index.html file.
04:20Select Upload and the page has been uploaded.
04:25What we're going to do is make sure that this bucket is enabled for static website hosting
04:33and making sure that it has the right permissions for users to access it.
04:36So, if you click on Properties, scroll down all the way to the bottom to Static Website Hosting.
04:43You can see by default it's disabled, but what we're going to do is enable it.
04:49And at the Index Document section, type in the Index Document, in my case index.html.
04:56Click Save Changes and another thing we need to do is, on permissions, we need to attach a bucket policy.
05:06So, click Edit and put in a bucket policy.
05:11I'll provide this bucket policy in the details below, so you can copy and paste this in.
05:18Here, you can see that there is the bucket name, but you would have to put in your own bucket
05:24name.
05:25So, I'm going to type in heckwithlucy.click.
05:31So, this policy is only a template, so you'll need to provide your own bucket name in order for this
05:38policy to work.
05:39So, click Save Changes, and we've now configured the bucket to have the sample website publicly accessible for viewers.
05:49So, once we go into this website, if you click on Open, you'll see the welcome message.
05:58And you see, you know, Welcome to my website, now hosted on Amazon S3.
06:02So, what you've done at this point is, you hosted the website on Amazon S3, but as you can see
06:07here on the URL, it's not your custom URL.
06:10This is an Amazon-provided URL.
06:13So, what we have to do now is, redirect techwithlucy.click to this S3 bucket.
06:20In order to do this, we will have to go back to Route 53.
06:24If you go back to Route 53 and click on the hosted zone, at this point, when we click on
06:32our domain name, we'll need to add an additional record.
06:36And this record is to make sure that the bucket will be connected to the Route 53 domain name.
06:42So, click on Create Record, choose the Simple Routing Policy, click Next, and now we're going to define a simple
06:49record.
06:50So, for the value, as I mentioned, the endpoint would have to be the S3 bucket.
06:56So, you can type in alias to S3 website endpoint.
06:59Choose the region where you hosted your bucket.
07:02In my case, the AP Southeast 2 region.
07:06And then select the S3 endpoint, and you can see it's already provided for me here.
07:12Click this, and then for the Evaluate Target Health, this is something for the demo, we'll just select No, and
07:18then create the record.
07:20By clicking Define Simple Record.
07:23And, yep, just double confirm here, create records.
07:27It does take up to a few minutes to propagate the changes.
07:31So, you can see techwithlucy.click is the custom domain, and you can see that it's pointing to the S3
07:36bucket and showing the same message.
07:38So, welcome to my website, now hosted on Amazon S3.
07:42In summary, what we did was we created an S3 bucket, uploaded our website content, and connected it to a
07:49custom domain name.
07:50So that when users type in your domain name into the browser, they can now view the website.
07:54Alright, so this brings us to the end of this video.
07:57Please give it a like if you enjoyed it, and I'll see you soon.
07:59Bye for now.
08:00Bye for now.
08:02Bye for now.
Comments
10