1 00:00:00,000 --> 00:00:02,850 ‫So here I am in the Amazon S3 console. 2 00:00:02,850 --> 00:00:04,020 ‫And the first thing I'm going to do 3 00:00:04,020 --> 00:00:05,970 ‫is of course to create a bucket 4 00:00:05,970 --> 00:00:08,610 ‫because this is where the data is being stored. 5 00:00:08,610 --> 00:00:10,470 ‫So the bucket name has to have a name 6 00:00:10,470 --> 00:00:12,570 ‫and if I enter a name that someone 7 00:00:12,570 --> 00:00:13,830 ‫has already taken from before, 8 00:00:13,830 --> 00:00:16,800 ‫for example, if I enter test and leave this box 9 00:00:16,800 --> 00:00:18,960 ‫and I try to create this bucket, 10 00:00:18,960 --> 00:00:20,100 ‫I'm gonna get an issue 11 00:00:20,100 --> 00:00:22,770 ‫saying that the bucket with the same name already exists. 12 00:00:22,770 --> 00:00:24,390 ‫So even though in my account 13 00:00:24,390 --> 00:00:26,970 ‫I've never created a bucket named test, 14 00:00:26,970 --> 00:00:28,980 ‫someone in someone's accounts 15 00:00:28,980 --> 00:00:32,460 ‫has created a bucket named test and it's already taken. 16 00:00:32,460 --> 00:00:36,000 ‫And so therefore I cannot name my bucket like this. 17 00:00:36,000 --> 00:00:40,950 ‫So instead, I will name this stephane-demo-s3. 18 00:00:40,950 --> 00:00:42,240 ‫Something like this. 19 00:00:42,240 --> 00:00:43,260 ‫And perfect, 20 00:00:43,260 --> 00:00:45,540 ‫this bucket name should not have been taken before. 21 00:00:45,540 --> 00:00:46,680 ‫We'll have a look at it 22 00:00:46,680 --> 00:00:49,440 ‫when I create this bucket but it should be unique. 23 00:00:49,440 --> 00:00:50,940 ‫Next, if we have a look, 24 00:00:50,940 --> 00:00:54,240 ‫there is a region this bucket needs to be into so 25 00:00:54,240 --> 00:00:55,680 ‫I'm choosing a region that is close to me, 26 00:00:55,680 --> 00:00:57,420 ‫for example the Ireland region 27 00:00:57,420 --> 00:01:00,510 ‫and you can choose a region that is close to you. 28 00:01:00,510 --> 00:01:02,340 ‫But you will notice on the right hand side 29 00:01:02,340 --> 00:01:05,310 ‫on the top right that the console says that 30 00:01:05,310 --> 00:01:08,700 ‫it's a global selection for the Amazon S3 service. 31 00:01:08,700 --> 00:01:10,770 ‫So that means that within the S3 service 32 00:01:10,770 --> 00:01:14,070 ‫you will see your buckets across all regions in one view. 33 00:01:14,070 --> 00:01:16,230 ‫But remember that your buckets are not global. 34 00:01:16,230 --> 00:01:20,820 ‫Your buckets are created and live only within one region. 35 00:01:20,820 --> 00:01:23,400 ‫Okay, perfect. So we have a name, we have a region. 36 00:01:23,400 --> 00:01:24,630 ‫For object ownership, 37 00:01:24,630 --> 00:01:26,520 ‫we're going to disable the ACLs for now. 38 00:01:26,520 --> 00:01:28,440 ‫I will now go over the setting. 39 00:01:28,440 --> 00:01:30,060 ‫There's another security setting here 40 00:01:30,060 --> 00:01:31,620 ‫to block all public access. 41 00:01:31,620 --> 00:01:33,750 ‫We will leave this on by default. 42 00:01:33,750 --> 00:01:34,583 ‫Same for versioning, 43 00:01:34,583 --> 00:01:36,810 ‫we'll leave the disabled by default. 44 00:01:36,810 --> 00:01:38,160 ‫And for default encryption 45 00:01:38,160 --> 00:01:39,993 ‫I will leave the default settings. 46 00:01:40,830 --> 00:01:43,110 ‫So we'll just go ahead and create a bucket 47 00:01:43,110 --> 00:01:46,080 ‫with these settings set as defaults. 48 00:01:46,080 --> 00:01:47,730 ‫So now as you can see, 49 00:01:47,730 --> 00:01:51,240 ‫I've successfully created my bucket, stephane-demo-s3 50 00:01:51,240 --> 00:01:53,430 ‫and it's here in my bucket view. 51 00:01:53,430 --> 00:01:55,770 ‫So again, we have in this view 52 00:01:55,770 --> 00:01:57,360 ‫access to all the buckets 53 00:01:57,360 --> 00:01:59,490 ‫because we're in the global setting 54 00:01:59,490 --> 00:02:03,300 ‫but each bucket is assigned to a specific region. 55 00:02:03,300 --> 00:02:06,210 ‫Okay, so next, let's go into this bucket 56 00:02:06,210 --> 00:02:07,960 ‫and close the left-hand side panel. 57 00:02:08,910 --> 00:02:09,960 ‫And now in my bucket 58 00:02:09,960 --> 00:02:11,880 ‫I would like to start uploading objects 59 00:02:11,880 --> 00:02:14,010 ‫because currently you have zero objects. 60 00:02:14,010 --> 00:02:16,050 ‫So let's click on upload. 61 00:02:16,050 --> 00:02:17,880 ‫And then we can add files. 62 00:02:17,880 --> 00:02:21,240 ‫And I'll navigate into your code, go into the S3 folder 63 00:02:21,240 --> 00:02:23,730 ‫and then you will find a coffee.jpg file 64 00:02:23,730 --> 00:02:25,800 ‫so choose this coffee.jpg file. 65 00:02:25,800 --> 00:02:27,930 ‫As you can see, it's an image/jpeg, 66 00:02:27,930 --> 00:02:30,360 ‫it has 100 kilobytes in size. 67 00:02:30,360 --> 00:02:34,020 ‫And then the destination is s3 stephane-demo, 68 00:02:34,020 --> 00:02:35,130 ‫which is my bucket. 69 00:02:35,130 --> 00:02:37,293 ‫Okay, so let's upload this file. 70 00:02:38,340 --> 00:02:39,173 ‫We're done. 71 00:02:39,173 --> 00:02:41,520 ‫So I can close this on the right-hand side. 72 00:02:41,520 --> 00:02:43,380 ‫And now back into my S3 bucket. 73 00:02:43,380 --> 00:02:45,390 ‫I can see the coffee.jpg file 74 00:02:45,390 --> 00:02:47,460 ‫is under my objects 75 00:02:47,460 --> 00:02:49,290 ‫so I can do is now click on it 76 00:02:49,290 --> 00:02:51,423 ‫and have more details around that file. 77 00:02:52,380 --> 00:02:54,900 ‫So now that we are in the object page, 78 00:02:54,900 --> 00:02:57,120 ‫we can have a look at a bunch of overview 79 00:02:57,120 --> 00:02:58,320 ‫so a bunch of properties, 80 00:02:58,320 --> 00:03:01,290 ‫where it's been uploaded, the size, the type 81 00:03:01,290 --> 00:03:02,610 ‫and there is an object URL here, 82 00:03:02,610 --> 00:03:04,170 ‫we'll be playing it in a moment. 83 00:03:04,170 --> 00:03:05,610 ‫So how do we do this? 84 00:03:05,610 --> 00:03:07,800 ‫So now we want to open this object 85 00:03:07,800 --> 00:03:09,780 ‫and see if we can open it, 86 00:03:09,780 --> 00:03:11,580 ‫we can view it because we have uploaded it 87 00:03:11,580 --> 00:03:13,710 ‫onto our Amazon S3 buckets. 88 00:03:13,710 --> 00:03:16,320 ‫Therefore, I'm going to click on open. 89 00:03:16,320 --> 00:03:18,300 ‫And if I do click on open, as you can see, 90 00:03:18,300 --> 00:03:20,070 ‫I can see my coffee.jpg file. 91 00:03:20,070 --> 00:03:21,750 ‫So this is the one I have uploaded 92 00:03:21,750 --> 00:03:23,220 ‫and it is on the internet. 93 00:03:23,220 --> 00:03:24,660 ‫Awesome, right? 94 00:03:24,660 --> 00:03:27,600 ‫But if I go back to my overview 95 00:03:27,600 --> 00:03:29,370 ‫and click on this object URL over here. 96 00:03:29,370 --> 00:03:32,670 ‫So I copy it, I paste it, and I enter it. 97 00:03:32,670 --> 00:03:35,550 ‫As you can see, I get an access denied. 98 00:03:35,550 --> 00:03:37,380 ‫And this access denied 99 00:03:37,380 --> 00:03:39,960 ‫tells me that I cannot access my object 100 00:03:39,960 --> 00:03:41,610 ‫using what's called the public URL. 101 00:03:41,610 --> 00:03:42,660 ‫So as you can see here, 102 00:03:42,660 --> 00:03:44,880 ‫this public URL is not working, 103 00:03:44,880 --> 00:03:46,530 ‫but this URL is working. 104 00:03:46,530 --> 00:03:47,880 ‫So what's the difference? 105 00:03:47,880 --> 00:03:50,100 ‫Well, this URL right here, if you have a look at it, 106 00:03:50,100 --> 00:03:52,320 ‫the beginning is exactly the same, 107 00:03:52,320 --> 00:03:55,750 ‫but then the rest is a very, very complicated and long 108 00:03:56,670 --> 00:04:01,260 ‫URL because it's called an S3 pre-signed URL. 109 00:04:01,260 --> 00:04:04,140 ‫Why? Well, because this URL contains actually 110 00:04:04,140 --> 00:04:06,060 ‫a signature that verifies 111 00:04:06,060 --> 00:04:07,920 ‫that I am the one making the request 112 00:04:07,920 --> 00:04:09,930 ‫and therefore it has my credentials in it. 113 00:04:09,930 --> 00:04:14,190 ‫And so because my credentials are encoded in this URL 114 00:04:14,190 --> 00:04:15,487 ‫then Amazon S3 says, 115 00:04:15,487 --> 00:04:18,510 ‫"Well, Stephane is allowed to view his own object, 116 00:04:18,510 --> 00:04:20,220 ‫therefore I will display it." 117 00:04:20,220 --> 00:04:22,530 ‫So this public URL does not work, 118 00:04:22,530 --> 00:04:25,470 ‫but this pre-signed URL with my own credentials works. 119 00:04:25,470 --> 00:04:28,620 ‫And obviously this URL is only for me. 120 00:04:28,620 --> 00:04:32,940 ‫So we'll see how to make that object public later on 121 00:04:32,940 --> 00:04:35,463 ‫so that the public URL will function as well. 122 00:04:36,360 --> 00:04:40,440 ‫So let's go back into our bucket, the stephane-demo-s3. 123 00:04:40,440 --> 00:04:43,500 ‫And I have one object but I can create a folder. 124 00:04:43,500 --> 00:04:46,710 ‫And this folder name may be called images. 125 00:04:46,710 --> 00:04:48,780 ‫So we scroll down and create this folder. 126 00:04:48,780 --> 00:04:51,990 ‫So now I have the images folder in my buckets. 127 00:04:51,990 --> 00:04:56,070 ‫I can click on it and within it I can upload, again, a file. 128 00:04:56,070 --> 00:04:59,790 ‫And this time I will upload the beach.jpg file into, 129 00:04:59,790 --> 00:05:02,760 ‫as you can see the destination is my images folder 130 00:05:02,760 --> 00:05:04,650 ‫within my S3 bucket. 131 00:05:04,650 --> 00:05:05,913 ‫So let's upload this. 132 00:05:06,750 --> 00:05:07,650 ‫Close this. 133 00:05:07,650 --> 00:05:10,380 ‫As we can see now we have the beach.jpg object 134 00:05:10,380 --> 00:05:12,330 ‫within the images folder. 135 00:05:12,330 --> 00:05:15,690 ‫And if I go one level up, we can see the folder here. 136 00:05:15,690 --> 00:05:17,130 ‫So this looks just like, you know, 137 00:05:17,130 --> 00:05:18,960 ‫the cloud storage service you used to know 138 00:05:18,960 --> 00:05:22,650 ‫such as Google Drive or Dropbox or whatever you want. 139 00:05:22,650 --> 00:05:24,660 ‫Here we have something very similar 140 00:05:24,660 --> 00:05:28,110 ‫in terms of the user experience on Amazon S3. 141 00:05:28,110 --> 00:05:30,000 ‫So of course I can go to images 142 00:05:30,000 --> 00:05:32,490 ‫and I can delete this folder entirely. 143 00:05:32,490 --> 00:05:34,860 ‫So this will delete everything within the folder. 144 00:05:34,860 --> 00:05:36,030 ‫And to delete things, 145 00:05:36,030 --> 00:05:39,720 ‫I just type permanently delete into the text input, 146 00:05:39,720 --> 00:05:42,390 ‫delete my objects, and I'm good to go. 147 00:05:42,390 --> 00:05:43,440 ‫So that's it for this lecture. 148 00:05:43,440 --> 00:05:47,010 ‫We've seen how we can upload objects into Amazon S3. 149 00:05:47,010 --> 00:05:49,470 ‫We've seen how we can open them in two different ways, 150 00:05:49,470 --> 00:05:51,990 ‫creating folders, deleting folders, and so on. 151 00:05:51,990 --> 00:05:53,220 ‫So I hope you liked it 152 00:05:53,220 --> 00:05:55,170 ‫and I will see you in the next lecture.