1
00:00:00,210 --> 00:00:05,730
In this video, we are going to continue to our hands on, which is a static website hosting on Amazon

2
00:00:05,730 --> 00:00:08,310
S3 using a PlayStation console.

3
00:00:08,700 --> 00:00:13,020
As you remember that in the last video, we have finished the first three step and now we are going

4
00:00:13,020 --> 00:00:17,100
to continue with the rest of the steps, four, five and six.

5
00:00:17,580 --> 00:00:25,030
So the first step the first step is the ADD the bucket policy that makes bucket content publicly available.

6
00:00:25,050 --> 00:00:30,990
So if you open the measurement console, you can see in here in the last video, we have removed the

7
00:00:30,990 --> 00:00:37,320
public access restriction and now it is available for the public access, but it will be configured

8
00:00:37,320 --> 00:00:45,660
these settings if you come this link and refresh the page again, it is turning 403 forbidden and access

9
00:00:45,660 --> 00:00:53,730
tonight because we have to set required bucket policy to access our bucket content from the public in

10
00:00:53,730 --> 00:01:00,390
locations for that purpose, open our pseudocode and I have created a separate folder and as you can

11
00:01:00,390 --> 00:01:04,860
see that now we are in this step four, five and six steps.

12
00:01:04,860 --> 00:01:07,770
So we will follow these configurations.

13
00:01:07,770 --> 00:01:13,560
So basically in the step four, we will add bucket policy that makes bucket content publicly available.

14
00:01:13,560 --> 00:01:17,940
So in order to do that, I'm going to go to buckets, permission and bucket policy.

15
00:01:18,000 --> 00:01:26,340
So if you open the our application mission console, if you go to the bucket and again, permission.

16
00:01:26,640 --> 00:01:29,550
So if you scroll down, you can see the bucket policy.

17
00:01:29,580 --> 00:01:35,250
The bucket policy, we should write a JSON format and it provides to access the objects stored into

18
00:01:35,250 --> 00:01:36,060
the bucket.

19
00:01:36,060 --> 00:01:39,930
And bucket policies don't apply to object owned by other accounts.

20
00:01:39,930 --> 00:01:46,440
So that means we should provide the bucket policy in order to give access to objects which included

21
00:01:46,440 --> 00:01:47,490
the bucket.

22
00:01:47,490 --> 00:01:49,560
So how we can write the bucket policy?

23
00:01:49,560 --> 00:01:56,190
If you come here and click the edit button, we can see that you can show the policy examples or policy

24
00:01:56,190 --> 00:01:57,360
generator in here.

25
00:01:57,390 --> 00:02:00,840
For example, let's see one by one policy examples.

26
00:02:00,840 --> 00:02:05,490
In this document you can scroll on and see some example policies.

27
00:02:05,490 --> 00:02:13,020
For example, in here we will give this kind of permission and this is an example bucket policy that

28
00:02:13,020 --> 00:02:18,720
is basically allowing for the get object and get object version for this resource type.

29
00:02:18,720 --> 00:02:26,010
So we will follow the same steps and we will create our bucket policy in order to give get object access

30
00:02:26,010 --> 00:02:28,260
from the public locations.

31
00:02:28,440 --> 00:02:30,240
Okay, let's get started.

32
00:02:30,240 --> 00:02:33,690
So in order to do that, please open the pseudocode.

33
00:02:33,690 --> 00:02:38,100
And in this pseudocode I'm going to create a bucket policy JSON.

34
00:02:38,100 --> 00:02:44,430
So here you can find that I have copy and paste from the documentation and only change for the seed

35
00:02:44,620 --> 00:02:48,660
is the name and ID you can give anything in here.

36
00:02:48,660 --> 00:02:52,620
And basically we are allowing all principles for the action.

37
00:02:52,620 --> 00:02:53,820
S3 get object.

38
00:02:53,850 --> 00:02:57,180
The resource of the are a run of the S3 bucket.

39
00:02:57,180 --> 00:02:58,620
So here is important.

40
00:02:58,620 --> 00:03:02,580
We should replace the bucket name as we create in this previous video.

41
00:03:02,610 --> 00:03:07,080
For that purpose, please go to our bucket and get the bucket name.

42
00:03:07,260 --> 00:03:12,570
You can see that we have bucket Erin and here is the bucket name in here.

43
00:03:12,570 --> 00:03:14,580
You can copy from here.

44
00:03:14,580 --> 00:03:22,200
And also you can go to buckets and go to bucket list, come here and copy it from here.

45
00:03:22,650 --> 00:03:24,570
So this is the our bucket name.

46
00:03:24,570 --> 00:03:30,570
So if you come back to our widget to do a quote, I'm going to replace only in here the bucket name.

47
00:03:30,750 --> 00:03:34,170
Please make sure that you have copy and paste bucket name in here.

48
00:03:34,170 --> 00:03:40,260
And the previous part should be the earn a S3 and these double quotes.

49
00:03:40,350 --> 00:03:47,640
Please don't forget to add Slash and the start character which is which is indicating the object that

50
00:03:47,640 --> 00:03:53,760
we are going to give access requirement for the object into S3 buckets.

51
00:03:53,760 --> 00:03:54,220
Okay.

52
00:03:54,390 --> 00:04:02,520
After that, please save this JSON file, copy this JSON file and go back to our policy statement here.

53
00:04:02,520 --> 00:04:06,810
You can see the our bucket policy statement under the bucket permissions.

54
00:04:06,810 --> 00:04:12,030
And if you scroll down and click the edit bucket policies, you can copy and paste in here.

55
00:04:12,060 --> 00:04:12,840
Yes.

56
00:04:12,840 --> 00:04:19,350
So here you can see the bucket policy, make sure that the first character should be the color bracket,

57
00:04:19,530 --> 00:04:24,120
otherwise it won't be correct and the whole structure will be the same.

58
00:04:24,120 --> 00:04:30,840
And the name of the run of the resource should be the our bucket name and should include slash start.

59
00:04:30,870 --> 00:04:35,490
So if you scroll down, you can now click the save change.

60
00:04:35,490 --> 00:04:42,990
If you click the save change, yes, this time I have get successfully edit the bucket policy and if

61
00:04:42,990 --> 00:04:49,410
you scroll down you can see the bucket policy under the bucket permission tab and here we give the required

62
00:04:49,440 --> 00:04:53,550
l0 and access to get object of our bucket.

63
00:04:53,550 --> 00:04:59,940
So now we have finished the fourth step if you come back to our command text.

64
00:05:00,110 --> 00:05:04,220
We have successful at the bucket position and create a bucket policy.

65
00:05:04,250 --> 00:05:11,870
Now we are going to configure an index documentation, index, HTML documentation because because we

66
00:05:11,870 --> 00:05:18,890
will perform static website hosting and our static document will be the index HTML that we are going

67
00:05:18,890 --> 00:05:21,950
to represent from the our browser Chrome browser.

68
00:05:21,980 --> 00:05:26,960
That's why I have created an index HTML file into our lecture folder.

69
00:05:26,960 --> 00:05:34,100
And here you can see the very basic HTML file that we are going to hosting on Amazon S3 so you can find

70
00:05:34,100 --> 00:05:36,680
the index HTML under the lecture folder.

71
00:05:36,710 --> 00:05:41,430
I'm going to upload these index HTML into our bucket as object.

72
00:05:41,540 --> 00:05:42,940
Okay, let's get started.

73
00:05:42,950 --> 00:05:49,280
So go back to our measurement console and go to buckets and come back to our newly created bucket.

74
00:05:49,280 --> 00:05:56,030
And this time I'm going to upload an object which will be the eight files, which will be the index

75
00:05:56,060 --> 00:06:03,740
JS file index, HTML file that is going to be hosting as a static website into our S3 bucket.

76
00:06:03,770 --> 00:06:11,540
I have added the index HTML and if you click the upload button now we are ready to access these index

77
00:06:11,780 --> 00:06:15,710
HTML from the publicly accessed any browser.

78
00:06:15,860 --> 00:06:19,850
So as you can see that we have continue our hands on up.

79
00:06:19,970 --> 00:06:26,540
In the next video we are going to test our website hosting on the Amazon S3 within working from the

80
00:06:26,540 --> 00:06:27,860
Chrome browser.
