-: Okay, so let's practice using our network load balancer.
So when you create a new network load balancer,
and as you can see it's TCP, TLS and UDP sort of traffic.
So let's create it.
And we do it again so demoNLB,
this scheme is internet facing,
the IP address type is IPv4
and then we have to choose VPC network mapping.
So for this, I'm going to select us-east-2a,
us-east-2b and us-east-2c.
So something interesting is that when you do select an az
for your NLB, you have an IPv4 address
and remember the NLB has fixed IPv4 addresses.
So you can either use an IPv4 assigned about AWS for this
or if you want to provide your own elastic IP address
you could do it so here by first creating your elastic IP,
and then assigning it to your NLD.
So this is a particularity of NLB
is that remember they have fixed IP.
So we can assign one fixed IP per availability zone,
which we will not do right now.
Okay, then in terms of a listener
we're going to be listening
on ports on the TCP protocol on port 80.
And so this will work because HTTP is relying
on TCP to work and so when we provide TCP port 80
we know things will work, but as you can see
there is no HTTP option here.
Well because, this is not an HTTP based load balancer,
is a TCP base load balancer so,
when the TCP on port 80 is correct, then forward to
and we need to create a target group specifically for this
so let's create a new target group for the NLB.
So there's going to be an instance based target group.
And the target group name is going to be my target group
and there'll be demo, okay.
On TCP port 80 and the VPC is the good one,
the health checks were just going to edit them.
So we're going to have three half healthy thresholds.
And the intro is going to be 10 seconds to
go a little bit quicker.
Okay, next we have to register targets
so let's register our three instances
and include a spending below their pending
and create a target group.
So this target group is specific
to my NLB and we have to see
whether or not the targets will be healthy or not.
So for now, let's go back to the NLB
we'll refresh this and we select the target groups
so this one, and then we're good to go.
So we can look at the summary and create
our Network Load Balancer.
So let's view our load balancer which is right here.
So now we have a ALD and an NLB.
So this is our NLB,
and we need to wait for it to be provisioned.
So I will pause the video right now.
Okay, so my NLD is now provisioned
and so it can open the URL, press enter.
And as you can see, things do not work right now.
So I have a good idea why there's not work
and I will show you in one second.
So if we look in our target groups
and we have two target groups right now,
the first one is HTTP, the second one is TCP.
Well, the HTTP one had three targets
and they were all healthy so that was great,
So we have three healthy targets,
but if we look at the NLD one in details and go to targets,
as you can see the three targets are unhealthy.
And that's because when you do a TCP based target group
and an NLB, while the security group that is taken
into account is a security group of the EC2 instances.
There was no security group we have created when
we created an NLB,
or when we created a target group that was on TCP.
So that means that to solve this problem
we have to edit the security group of our instance.
So if we go back to launch wizard one, and then
for inbound rules, as we can see the HTTP port 80
is only allowing my first load balancer security group,
but we need to create a new rule to just allow back HTTP
from anywhere for the network load balancers to work
so I would just do it from anywhere,
it says, necessary for the NLB.
And the reason is because the NLB just forwards
over the traffic from the clients
into the institute instance.
And so from an institute instance perspective,
the traffic doesn't look like it's coming from the NLB.
It looks like it's coming from an external client.
So once we've added this rule for the NLB,
then if we go back into our target group
this one and open it,
we should seeing very very soon
that the instance will become healthy
so let's just wait one minute.
And so now my instances are becoming healthy.
So after a refresh, we have three of them being healthy
thanks to the security group change.
So that means that if I go back to my NLB and refresh
here we go, we get the Hello World from an instance.
And then if I keep on refreshing, as you can see,
I am redirected to the same instance
so that means that the connection is somewhat sticky
but at least we know that our NLB is working.
So to just close on this, hands-on,
we just need to go ahead and delete the NLB
and delete the target group
so I will delete the NLB right here.
I will delete this target group that was a demo for the NLD.
Yes, please.
And then for the security group, I'm going to
go back into my security group,
and I'm going to edit the rules
to just remove this one
again to go back to the state we were
when we had an application load balancer.
So that's it for this hands-on.
I hope you liked it and I will see you in the next lecture.