Okay. So now that may not instances stopped or terminated,
we do not have access to the internet.
So if I do curls.com ah, is not going to work. Okay.
So let's fix this and go ahead with NAT Gateway.
So first let me refresh this private route table.
And as we can see now,
this destination
targeting this ENI is a black hole and
black hole means that this rule is not active anymore.
Why? Because where we have stopped our net instance and
therefore I will see this fruit does not lead to anything.
So this is why also it's really good to use managed services
and not, NAT instances.
So we are going to create a NATs Gateway
and I call it 'DemoNATGW'.
Now, when you choose a subnet for the NAT Gateway
which should be in so
for high availability,
we need to use multiple subnets.
But right now we'll start with one PublicSubnetA
and the connectivity type is going to be public.
And then we need to allocate an elastic IP
to this NAT gateway. So let's allocate one.
Okay. These us to get IP has been allocated,
and then we'll just click on create NAT gateway.
So this is NAT gateway has been created.
So while then that gateway is being created.
What I can do is edit my route table.
So I will go back into my route table,
look at my private route table,
and then I will edit them.
So let's edit the routes in it.
And this route that was a black hole obviously
will not, we don't need anymore.
So instead we want to send internet traffic out
to a NAT Gateway
and we'll use the 'DemoNATGW'
we've created from before.
So let's save this.
So now we don't have black holes.
We have two active rules
and one of them is sending it to
our NAT Gateway.
Now we can take a little bit of time for a NAT Gateway
to be active, as you can see,
the state is still pending.
So what I'm going to do is pause the videos
and get back to you when this is done.
And here we go, it is active.
And so let's go back into our Institute instance. This one,
yes, I'm still connected.
This is perfect. So if I do curl a google.com,
then it's working and ping, google.com, is working as well.
So the NAT Gateway is active and are EC2 instance
is sending traffic into it.
And we didn't have to specify any security group rules.
We didn't have to specify many things
just to create this Nat Gateway,
but send it into a subnet and then
edit the route table.
And here we go.
My instance in this...
private subnets can get access to the
internet. That means that's.
For example, we can do sudo yum, and then updates,
for example, our operating system,
without making this instance public,
which is really good.
So just to finish,
we have created one NAT Gateway
in one specific...
abilities zone,
but we could create a second yet NAT Gateway
that in another abilities zones,
and then edit the route tables to make it
highly available.
Now, this is not something we're going to do
in this lecture,
but remember the architecture diagram from before. Again,
if you want it to make it a highly available setup,
you would need to set up multiple, NAT Gateways
for be able to resist a disaster affecting an entire AC.
So that's it for this lecture. I hope you liked it.
And I will see you in the next lecture.