Check out a free preview of the full AWS For Front-End Engineers, v2 course

The "Setup a Domain with S3 & Route 53" Lesson is part of the full, AWS For Front-End Engineers, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Steve uses Route 53, the AWS DNS manager, to register a new domain name. After the domain is registered, an S3 bucket is created and configured to be publically available.

Preview
Close

Transcript from the "Setup a Domain with S3 & Route 53" Lesson

[00:00:00]
>> So let's talk a little bit about route 53 in this case. Route 53 which despite me having looking up where route 53 is in the US multiple times. So that I can make some kind of comment at this exact moment I've since forgotten where it is, is basically their DNS service, right?

[00:00:21]
And route 53 has a lot of really cool features most of which we don't need in this case. It has stuff like, cool you can have your servers hosted multiple places and it will detect if one goes down and doesn't pass a health check and route all the traffic to another server.

[00:00:38]
Or if one is slower from a given place it will route it to the faster one so on and so forth. We need it for registering a domain name. If you have a domain name somewhere else you can use that you do need to probably tell route 53 about it at some point.

[00:00:54]
One of the reasons though, if you are going to get a new domain name that I would recommend doing route 53 is hooking it up to some of the other Amazon stuff is incredibly simple, right? If you host it somewhere else and like it's going to be a little bit trickier, right?

[00:01:11]
There are guides on how to point it route 53 and then get the rest of that for free that's kind of somewhat outside the scope of this because each one will be slightly different. But I'm gonna go ahead and register a domain with route 53 in this case.

[00:01:24]
This is a totally optional part if you don't want to do it, you don't have to. I'm gonna do it for anyone that needs to, right, or wants to but if you just want to use whatever the CloudFront domain that we get towards the end of the workshop is totally fine.

[00:01:39]
You won't miss out on anything except some ridiculous domain name as I live shop for domain names. Awesome whenever you try to get a.com. We'll go ahead and say what's a dot cheap Not too cheap, too cheap to pay for a dot cheap. I'm not paying $30 for a domain name.

[00:02:05]
Dot click, where's dot click? Yeah three, yeah, dot click is three bucks. We're gonna do that. So we'll go ahead and say super awesome dot. Nope don't put that space in there autocomplete. Awesome and put that in my cart on pay $3 for this domain name. I'm gonna pause for a moment in case you're doing this with me.

[00:02:38]
I've done this now multiple times. And every time I put it in the cart, and I look for the button to buy the domain name. Yeah, some of you are like, I don't see the button. Don't scroll. You got to scroll all the way down and it's underneath.

[00:02:54]
The rest of the options have once you could have put in your cart, it lives down there. It doesn't matter how many times I've done this. I literally just now was like, where's the button, and then I remembered how angry I get this moment. Cool, at that point you will put in your registering contact.

[00:03:12]
So I'm also going to we're going to cut to a break in a second and I'm going to fill this piece out. So I've registered it, the one thing I want to point out is theoretically I have received an email. I have 15 days to verify that email if not they will suspend it and they are reminding me that a suspended domain is not available on the Internet, which is my understanding of what would happen if you suspended a domain.

[00:03:37]
So if you right now want to go check, you can go absolutely do that. I'm not. I live dangerously also, I'm not super invested in this. So you can see domain registration is in progress. So that is good we will kind of let that cook for a little bit it's like a cooking show where you put something in the oven for a little bit and maybe there's an already done Turkey somewhere as well.

[00:04:01]
We'll let that cook and we'll go back to setting up our S3 bucket. So with that, we'll say S3, One thing that we don't have to really worry about now because S3 is global is there are certain things that like for instance some of the lambda edge stuff that we're gonna talk about that is only available in US East one.

[00:04:28]
So I'm going to kind of point that out now and remind later we're still not at that point yet. But right now at this moment in Minneapolis, Minnesota, I guess closest to US East Two, Denver gets me closer to US West so it's real, real hit or miss where we make those decisions.

[00:04:46]
But be in US East one for this workshop is probably the easiest. Otherwise you might have to sometimes jump over to US East one for things. So I will kind of point that out at some point. But, S3 is global in this case, so we don't necessarily need to worry about it.

[00:05:01]
Let's go ahead. We have two buttons that we can click, for creating a bucket, whichever one makes you happier. For me personally, the orange one makes me happier, so I'm gonna click that one, and we're gonna give it a name and superawesome.click. And here's my first opportunity to put this in the right region.

[00:05:21]
So I'm gonna go put it in US East one. Like I said, it's not a total requirement, generally speaking, if for some reason, like let's say this was a bucket that you were doing a bunch of data analytics, and you needed to use it as a data lake.

[00:05:35]
So you could process stuff from your local machines or something along those lines, you might choose a region closest to you. It doesn't always have to be US East one, just to make sure we're all on the same page, both on the live stream and recording and in the room, let's all just get in the same region.

[00:05:54]
And let's make that US East one for some reasons. Not all Amazon features are available in all the regions but US East one almost always gets everything first. So it's make sense to just pick that one as our default in this case. All right, we don't seek to choose an existing bucket to copy our settings from.

[00:06:13]
That should be obvious why the reason because we don't have one. Okay, so then ACLs for specific objects, access control lists, we're gonna go with the recommended option here, which is don't do it. This is going to be a controversial section that we're going to have to, we're gonna turn on and off at different points in our lives.

[00:06:35]
This is blocked all public access settings for the bucket. At various times, there weren't as much rules around this as why people ended up with the public buckets sometimes are also I've heard stories where there was an outage. Somebody made the bucket public real quick to go ahead and fix something.

[00:06:56]
Then the outage was over. The bucket was still public, right? So, but it's tricky for us, right? We want to put a webpage on the Internet people to look at publicly, right? So for us at this moment we're going to turn it off because we don't have all the pieces we need to kind of do the kind of wiring through AWS around this stuff.

[00:07:21]
So we're going to turn it off for now you can see that they are very, very strict about this, we will add some policies stuff along those lines. But for now, that is going to be the case and we'll talk about different things that we can do at various points as well.

[00:07:41]
Okay, we talked about bucket versioning earlier in the slides. This was again if you wanna keep every previous version we have get where we can go back to previous versions. Also, in the case of the react app that I have webpack is going to stamp each version. And so the same way I told you that, I don't delete the previous generated files.

[00:08:03]
It's kinda like I have my own versioning, right, in my eyes. But if you were storing things where you might need all the previous versions of whatever their data was, you can turn versioning on. It does incur a cost because it's just more storage, right? So we're gonna keep that disabled and we'll have the tags we're not gonna be using them.

[00:08:27]
We again also don't need server side encryption and advanced settings we don't need that either. And with that I have my first bucket.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now