WEBVTT

1
00:00:00.300 --> 00:00:01.200
<v Instructor>Okay, so let's go ahead</v>

2
00:00:01.200 --> 00:00:03.030
and launch EC2 instances.

3
00:00:03.030 --> 00:00:05.560
So they will appear in systems manager.

4
00:00:05.560 --> 00:00:06.393
And for this,

5
00:00:06.393 --> 00:00:10.410
we want them to appear under our fleet manager,

6
00:00:10.410 --> 00:00:12.511
which is a way for us to see where

7
00:00:12.511 --> 00:00:14.690
the instances have been registered.

8
00:00:14.690 --> 00:00:16.440
And so what we need to do is to complete this,

9
00:00:16.440 --> 00:00:18.190
SSM Agent and installation,

10
00:00:18.190 --> 00:00:19.750
and then it would appear here. Okay.

11
00:00:19.750 --> 00:00:21.150
So right now, as we can see,

12
00:00:21.150 --> 00:00:24.420
we have zero managed instances in fleet manager,

13
00:00:24.420 --> 00:00:25.808
but let's go into services.

14
00:00:25.808 --> 00:00:27.273
I'll go into EC2

15
00:00:27.273 --> 00:00:30.272
and I'm going to launch an instance.

16
00:00:30.272 --> 00:00:33.149
I will choose the Amazon Linux 2 AMI

17
00:00:33.149 --> 00:00:34.940
and of type t2.micro

18
00:00:34.940 --> 00:00:36.490
to remain within the free tier.

19
00:00:37.550 --> 00:00:40.890
And I will launch three instances. Okay.

20
00:00:40.890 --> 00:00:42.530
And when we do this,

21
00:00:42.530 --> 00:00:43.900
where the language would be launched in the same

22
00:00:43.900 --> 00:00:45.184
availability zone, that's fine.

23
00:00:45.184 --> 00:00:47.600
And for IAM role, this is very important.

24
00:00:47.600 --> 00:00:50.490
We need to create an IAM role that will allow

25
00:00:50.490 --> 00:00:51.550
this EC2 instance

26
00:00:51.550 --> 00:00:54.690
to talk to the systems manager service.

27
00:00:54.690 --> 00:00:57.150
So to do so what I'm going to do is click

28
00:00:57.150 --> 00:00:59.263
on IAM role and create a new IAM role.

29
00:01:02.570 --> 00:01:07.530
So create a role for EC2 instances, next permissions.

30
00:01:07.530 --> 00:01:08.580
And in the policy,

31
00:01:08.580 --> 00:01:10.360
I will look for a managed policy

32
00:01:10.360 --> 00:01:11.660
named AmazonEC2RoleforSSM.

33
00:01:13.710 --> 00:01:14.922
And this policy contains,

34
00:01:14.922 --> 00:01:18.650
if you look at the summary enough permissions to write

35
00:01:18.650 --> 00:01:21.130
to the systems manager service,

36
00:01:21.130 --> 00:01:22.810
to register the instance with it.

37
00:01:22.810 --> 00:01:24.715
So let's select this.

38
00:01:24.715 --> 00:01:26.600
AmazonEC2RoleforSSM,

39
00:01:26.600 --> 00:01:29.090
click on the next tags, next review.

40
00:01:29.090 --> 00:01:31.973
And I will call this one, AmazonEC2RoleforSSM.

41
00:01:34.950 --> 00:01:38.530
Great, let's create this role.

42
00:01:38.530 --> 00:01:39.620
And we're going to leverage this role.

43
00:01:39.620 --> 00:01:42.270
So I will refresh.

44
00:01:42.270 --> 00:01:44.810
And now we have this AmazonEC2RoleforSSM.

45
00:01:44.810 --> 00:01:46.950
And so this role combined with the AMI,

46
00:01:46.950 --> 00:01:47.870
we have chosen so far,

47
00:01:47.870 --> 00:01:51.470
which is the Amazon Linux 2 AMI will allow us to see our

48
00:01:51.470 --> 00:01:53.090
instance into systems manager

49
00:01:53.090 --> 00:01:55.150
because the Amazon Linux 2 AMI

50
00:01:55.150 --> 00:01:57.439
contains the SSM agent already configured.

51
00:01:57.439 --> 00:02:00.510
And they will try to launch at good time as well.

52
00:02:00.510 --> 00:02:03.450
So, at storage where I go to add tags,

53
00:02:03.450 --> 00:02:04.860
configure security group

54
00:02:04.860 --> 00:02:06.450
and here I'm going to create a new security group.

55
00:02:06.450 --> 00:02:07.983
I'll call it SSMSG,

56
00:02:09.113 --> 00:02:11.170
and it will keep the description right here.

57
00:02:11.170 --> 00:02:13.990
And I will remove the SSH rule right here.

58
00:02:13.990 --> 00:02:15.420
And I will show you why later on.

59
00:02:15.420 --> 00:02:20.180
So currently our instances can not be accessed using SSH.

60
00:02:20.180 --> 00:02:21.760
We review the launch, launch

61
00:02:21.760 --> 00:02:23.420
and I will use this key pair yes

62
00:02:23.420 --> 00:02:25.293
and launch my instances.

63
00:02:26.330 --> 00:02:27.163
So now,

64
00:02:27.163 --> 00:02:29.880
if we go into our services

65
00:02:29.880 --> 00:02:31.510
and we look at the three of them,

66
00:02:31.510 --> 00:02:32.550
they're pending right now,

67
00:02:32.550 --> 00:02:33.800
in the pending state,

68
00:02:33.800 --> 00:02:35.310
and then they're going to be launching.

69
00:02:35.310 --> 00:02:36.610
And then after being launched,

70
00:02:36.610 --> 00:02:39.000
we should see them being managed into this.

71
00:02:39.000 --> 00:02:41.790
I'm going to pause the video until this happens.

72
00:02:41.790 --> 00:02:43.250
So my instances are now running

73
00:02:43.250 --> 00:02:44.800
and it's been running for a while.

74
00:02:44.800 --> 00:02:47.840
And if I go back to my fleet manager now,

75
00:02:47.840 --> 00:02:50.649
and I will just refresh this as we can see,

76
00:02:50.649 --> 00:02:54.587
my three instances are not managed by fleet manager.

77
00:02:54.587 --> 00:02:56.800
And we can see the operating system is Amazon Linux.

78
00:02:56.800 --> 00:02:58.471
We can see the SSM Agent version

79
00:02:58.471 --> 00:03:00.800
as well as the Agent ping status,

80
00:03:00.800 --> 00:03:01.850
which is online.

81
00:03:01.850 --> 00:03:02.870
And as you can see,

82
00:03:02.870 --> 00:03:06.090
this is not fleet manager accessing our EC2 instance

83
00:03:06.090 --> 00:03:09.210
because we have closed all the security port

84
00:03:09.210 --> 00:03:10.210
for inbound rules.

85
00:03:10.210 --> 00:03:14.352
This is instead the Amazon SSM Agent that is reaching out

86
00:03:14.352 --> 00:03:17.630
to the fleet manager service to be registered.

87
00:03:17.630 --> 00:03:18.463
So it's pretty cool.

88
00:03:18.463 --> 00:03:20.280
As we can see now we have three instances

89
00:03:20.280 --> 00:03:21.460
registered in SSM.

90
00:03:21.460 --> 00:03:23.480
That means we can start operating some pretty equal

91
00:03:23.480 --> 00:03:25.000
operations with the features.

92
00:03:25.000 --> 00:03:26.900
So I will see you in the next lecture.

