1 00:00:00,700 --> 00:00:03,940 You've got an AWS account, so let's start learning about one of the simplest 2 00:00:03,940 --> 00:00:09,730 services in AWS, Amazon S3, used for storing and retrieving files. 3 00:00:09,730 --> 00:00:12,370 Files in S3 are stored inside of something called a bucket, 4 00:00:12,370 --> 00:00:15,070 which is a new concept that requires a bit of explanation. 5 00:00:15,070 --> 00:00:19,690 A lot of people use S3 for storage, files are constantly being uploaded and 6 00:00:19,690 --> 00:00:21,590 downloaded all over the world, and 7 00:00:21,590 --> 00:00:25,270 everyone using it expects to see their files and no one else's. 8 00:00:25,270 --> 00:00:28,010 Can you imagine how embarrassing it would be if you uploaded some 9 00:00:28,010 --> 00:00:31,230 private pictures to S3 and someone else was able to see them? 10 00:00:31,230 --> 00:00:36,350 Fortunately, it doesn't work that way, all the files in S3 are divided into buckets, 11 00:00:36,350 --> 00:00:39,010 and you can only see the files in your own bucket. 12 00:00:39,010 --> 00:00:40,360 And what is a bucket? 13 00:00:40,360 --> 00:00:45,020 Just like a real world bucket, a bucket in S3 is designed to hold things. 14 00:00:45,020 --> 00:00:47,850 You bucket holds your files, and other buckets hold files for 15 00:00:47,850 --> 00:00:51,820 other people, that way you won't share files unintentionally. 16 00:00:51,820 --> 00:00:56,060 S3 buckets help keep your files private and secure, every file on S3 17 00:00:56,060 --> 00:01:00,730 must be stored in a bucket, so you can't use S3 without having at least one bucket. 18 00:01:00,730 --> 00:01:02,990 Let's dive in and learn how to create one. 19 00:01:02,990 --> 00:01:07,290 Log into your AWS account and go to the AWS Management Console. 20 00:01:07,290 --> 00:01:10,912 The S3 service is under the Storage section, you can click on that link or 21 00:01:10,912 --> 00:01:13,551 search for S3 in the search box at the top of the page. 22 00:01:15,509 --> 00:01:18,792 Now, we're on the S3 Management Console, as you can see, we don't 23 00:01:18,792 --> 00:01:22,658 have any buckets yet, so S3 is giving us some information for how to get started. 24 00:01:22,658 --> 00:01:27,050 It's a three-step process, Create a new bucket, Upload your data, and 25 00:01:27,050 --> 00:01:28,620 Set up your permissions. 26 00:01:28,620 --> 00:01:31,810 In this video, we're only going to do the first step, but other videos in 27 00:01:31,810 --> 00:01:34,730 this course will show you how to do the second and third steps, as well. 28 00:01:34,730 --> 00:01:37,680 To create a new bucket, you can either click on the Get started button 29 00:01:37,680 --> 00:01:41,035 at the bottom or on the Create bucket button at the top-left. 30 00:01:43,200 --> 00:01:46,910 Now, we have to type in a few piece of information to create the bucket. 31 00:01:46,910 --> 00:01:50,390 The first one is the most complicated, picking a name for your bucket. 32 00:01:50,390 --> 00:01:53,320 The field says it has to be a DNS-compliant bucket name, 33 00:01:53,320 --> 00:01:55,630 which means it would be valid for a URL. 34 00:01:55,630 --> 00:01:58,090 You can also see there's a little info message here, 35 00:01:58,090 --> 00:02:02,350 the bucket name must be unique across all existing bucket names in Amazon S3. 36 00:02:02,350 --> 00:02:05,620 There's also something about Cloudfront, but we can ignore it for now. 37 00:02:05,620 --> 00:02:07,150 So what does that all mean? 38 00:02:07,150 --> 00:02:09,920 These are the rules for naming buckets in S3, 39 00:02:09,920 --> 00:02:13,880 your name has to be at least three characters long and no more than 63. 40 00:02:13,880 --> 00:02:19,080 You can only use lower case letters, numbers, hyphens, and periods. 41 00:02:19,080 --> 00:02:23,490 That means, you can't use uppercase letters, spaces, or special characters. 42 00:02:23,490 --> 00:02:27,380 The name can't start or end with a hyphen or a period. 43 00:02:27,380 --> 00:02:30,090 You can't have two periods next to each other. 44 00:02:30,090 --> 00:02:34,140 And finally, if someone else has already claimed the name you want, you're out of 45 00:02:34,140 --> 00:02:38,400 luck, you'll have to pick a different name that isn't currently being used. 46 00:02:38,400 --> 00:02:41,360 Fortunately, the bucket creation form is smart enough to tell you when 47 00:02:41,360 --> 00:02:43,670 you make a mistake with selecting a name. 48 00:02:43,670 --> 00:02:48,100 For example, let's say I try to create a bucket named a, as you can see, 49 00:02:48,100 --> 00:02:49,450 that's too short. 50 00:02:49,450 --> 00:02:54,270 But if I add two more characters, then the warning disappears. 51 00:02:54,270 --> 00:02:56,310 Now, we've got three characters, which is enough. 52 00:02:56,310 --> 00:02:58,960 But if I add a capital letter, that's not allowed. 53 00:02:58,960 --> 00:03:00,760 Same with special characters, 54 00:03:00,760 --> 00:03:04,270 see each time a try it tells me that it's not allowed. 55 00:03:04,270 --> 00:03:08,480 But it's not complaining about the name abc, at least not yet. 56 00:03:08,480 --> 00:03:09,180 Let's move on for now. 57 00:03:10,190 --> 00:03:14,770 Next, I need to select a Region, as you can see, there are a lot of options. 58 00:03:14,770 --> 00:03:15,939 When you select a region, 59 00:03:15,939 --> 00:03:18,979 you're telling S3 where in the world you want it to hold your data. 60 00:03:18,979 --> 00:03:20,567 It doesn't really make much difference, 61 00:03:20,567 --> 00:03:23,520 since you can still access your data from anywhere in the world. 62 00:03:23,520 --> 00:03:27,590 However, different regions have slightly different prices, and a region that is 63 00:03:27,590 --> 00:03:31,490 geographically closer to you will be faster than one that is farther away. 64 00:03:31,490 --> 00:03:32,615 I'm going to use the U.S. 65 00:03:32,615 --> 00:03:37,260 West (Oregon) region, but I suggest that you use whatever region is closest to you. 66 00:03:37,260 --> 00:03:40,330 Now, it's asking if we want to copy settings from an existing bucket. 67 00:03:40,330 --> 00:03:45,764 We don't have any existing buckets, so we can skip this, I'll press the Next button. 68 00:03:45,764 --> 00:03:50,667 Oops, I thought that might happen, the name abc is already taken by someone else, 69 00:03:50,667 --> 00:03:54,910 so I'll need to pick a different name, how about treehouse-course. 70 00:03:54,910 --> 00:03:57,600 You'll notice that I can't pick a name that ends with a dash, 71 00:03:57,600 --> 00:03:59,050 that's another rule that I mentioned earlier. 72 00:04:00,160 --> 00:04:02,108 Anyway, let's see if this name is taken. 73 00:04:05,287 --> 00:04:07,230 Great, that means it's available. 74 00:04:07,230 --> 00:04:09,460 We can ignore everything else on here for now, so 75 00:04:09,460 --> 00:04:12,850 just keep pressing the Next button until you get to the confirmation page. 76 00:04:12,850 --> 00:04:13,850 Double check that the name and 77 00:04:13,850 --> 00:04:17,420 location are what you want, then click Create bucket. 78 00:04:17,420 --> 00:04:19,260 Great, looks like it worked. 79 00:04:19,260 --> 00:04:22,050 You can create multiple buckets if you want to, and that can be a good idea if 80 00:04:22,050 --> 00:04:25,180 you're storing multiple files that should be kept separate from each other. 81 00:04:25,180 --> 00:04:28,310 For example, you probably want to save pictures of your family, and 82 00:04:28,310 --> 00:04:31,820 you probably want to save copies of important documents like tax forms, but 83 00:04:31,820 --> 00:04:34,070 you probably want to keep them separate from each other. 84 00:04:34,070 --> 00:04:36,460 I'll make a new bucket for my family pictures. 85 00:04:36,460 --> 00:04:37,873 Let's see if this name is available. 86 00:04:40,798 --> 00:04:45,114 Yes it is, click Next, Next, 87 00:04:45,114 --> 00:04:48,950 Next, and Create, done. 88 00:04:48,950 --> 00:04:50,990 Now, I've got two different buckets. 89 00:04:50,990 --> 00:04:54,690 You can have up to 100 different S3 buckets at any one time. 90 00:04:54,690 --> 00:04:58,360 If you decide that you don't need a bucket anymore, you can delete it. 91 00:04:58,360 --> 00:05:01,930 First, select the bucket by clicking on its row in the bucket list, 92 00:05:01,930 --> 00:05:03,330 don't click on the Bucket name itself, 93 00:05:03,330 --> 00:05:06,230 because that will open the bucket, which is not what we want. 94 00:05:06,230 --> 00:05:11,659 Instead, click on the row, and then click on the Delete bucket button. 95 00:05:11,659 --> 00:05:14,723 AWS makes you confirm that you really want to delete the bucket, and 96 00:05:14,723 --> 00:05:17,480 makes you type in the name of the bucket you selected. 97 00:05:17,480 --> 00:05:19,633 I'll do that now, since I'm sure I don't need this bucket. 98 00:05:23,937 --> 00:05:26,529 Creating and deleting buckets in S3 is basically free, 99 00:05:26,529 --> 00:05:30,880 you'd have to do it over a thousand times in a month for it to cost even a penny. 100 00:05:30,880 --> 00:05:33,120 Plus, it's covered under the free tier, so for 101 00:05:33,120 --> 00:05:36,260 the first year of your AWS account, it's completely free. 102 00:05:36,260 --> 00:05:39,870 Try making a bucket or two on your own AWS account, and in the next video, 103 00:05:39,870 --> 00:05:41,810 we'll learn how to store files in a bucket.