Instructor: Okay, so let's go ahead
and launch EC2 instances.
So they will appear in systems manager.
And for this,
we want them to appear under our fleet manager,
which is a way for us to see where
the instances have been registered.
And so what we need to do is to complete this,
SSM Agent and installation,
and then it would appear here. Okay.
So right now, as we can see,
we have zero managed instances in fleet manager,
but let's go into services.
I'll go into EC2
and I'm going to launch an instance.
I will choose the Amazon Linux 2 AMI
and of type t2.micro
to remain within the free tier.
And I will launch three instances. Okay.
And when we do this,
where the language would be launched in the same
availability zone, that's fine.
And for IAM role, this is very important.
We need to create an IAM role that will allow
this EC2 instance
to talk to the systems manager service.
So to do so what I'm going to do is click
on IAM role and create a new IAM role.
So create a role for EC2 instances, next permissions.
And in the policy,
I will look for a managed policy
named AmazonEC2RoleforSSM.
And this policy contains,
if you look at the summary enough permissions to write
to the systems manager service,
to register the instance with it.
So let's select this.
AmazonEC2RoleforSSM,
click on the next tags, next review.
And I will call this one, AmazonEC2RoleforSSM.
Great, let's create this role.
And we're going to leverage this role.
So I will refresh.
And now we have this AmazonEC2RoleforSSM.
And so this role combined with the AMI,
we have chosen so far,
which is the Amazon Linux 2 AMI will allow us to see our
instance into systems manager
because the Amazon Linux 2 AMI
contains the SSM agent already configured.
And they will try to launch at good time as well.
So, at storage where I go to add tags,
configure security group
and here I'm going to create a new security group.
I'll call it SSMSG,
and it will keep the description right here.
And I will remove the SSH rule right here.
And I will show you why later on.
So currently our instances can not be accessed using SSH.
We review the launch, launch
and I will use this key pair yes
and launch my instances.
So now,
if we go into our services
and we look at the three of them,
they're pending right now,
in the pending state,
and then they're going to be launching.
And then after being launched,
we should see them being managed into this.
I'm going to pause the video until this happens.
So my instances are now running
and it's been running for a while.
And if I go back to my fleet manager now,
and I will just refresh this as we can see,
my three instances are not managed by fleet manager.
And we can see the operating system is Amazon Linux.
We can see the SSM Agent version
as well as the Agent ping status,
which is online.
And as you can see,
this is not fleet manager accessing our EC2 instance
because we have closed all the security port
for inbound rules.
This is instead the Amazon SSM Agent that is reaching out
to the fleet manager service to be registered.
So it's pretty cool.
As we can see now we have three instances
registered in SSM.
That means we can start operating some pretty equal
operations with the features.
So I will see you in the next lecture.