- All right, so now let's run through a demo
of adding a subnet to an existing VPC.
So here we are, logged in to the ADV US console.
I'm on the VPC dashboard.
And what I want to do is filter
by the VPC that we recently created.
In this case the one at 10 2 00/16.
And then from there, I'm gonna go to subnets.
And you'll see that we don't have any
for this VPC yet.
Now it's important to note,
that you can't launch resources
such as EC2 instances, virtual machines,
or databases, directly into a VPC.
You have to have a subnet,
in order for resources to
have a place to live in the network.
And so we're going to create a subnet.
Now here, I might call this one
our public A.
Because I'm going to put this one,
you'll notice, that I'm going to choose
an availability zone here.
Again, subnets are specific to an availability zone.
So this one is going to be my public subnet
in us-east-2a.
Us-east-2, being the Ohio Region.
Now when I set the slider block
for that subnet, it has to fall
within the range of our VPC
being 10 2 00/16.
I could create a subnet that takes up
the entire range of the VPC if I wanted to.
But by doing so, that would prevent me
from creating any more.
And that's not what I wanna do.
So here, I'm just gonna do 10.2.0.0/24.
That would give me somewhere around 250
useable IP addresses.
So I'm gonna go ahead and create that.
Okay, and sometimes it takes it
a few seconds, it shouldn't take
no more than a minute.
There we go.
And now we can see that we've created a subnet.
We can see what VPC it belongs to.
It belongs to our ADV US live lessons
10 two 16 subnet.
And this subnet has this particular slider range.
Now you might be wondering, a slash 24,
if you're familiar with slider notation,
you would know that slash 24
would allow up to 256 IP addresses.
It's important to note,
that the first four, for any given subnet,
the first four, and the last one address,
are reserved by Amazon for special purposes.
The last address being the dot 255
is the broadcast address.
And that's not used by AWS, so they reserve it.
The first four are reserved for
special purposes like routing
and local VPC DNS.
So we have a subnet in the us-east-2a availability zone.
And we'll go ahead and create one more.
Just to run through it one more time.
And I'm gonna call this Public B, again.
This is arbitrary, what you name it is up to you.
It depends on what this particular subnet
is being used for.
I'm gonna make sure I have the right,
I don't want the default VPC,
I want the one that I created recently.
And this one, I'm going to use
2b availability zone.
Which, again, is a completely different
set of data centers somewhere down the road
away from 2a.
In this case, I'm going to use 10.2.1.0
so that I don't overlap with the previous one.
Again, slash 24 and create that as well.
So there we go, we have our two subnets
that we've created.
Public A and Public B.