In this video, we're going to explore a fundamental building block of cloud computing
called virtual private cloud or VPC.
A VPC is a virtual Network that
you control that resembles a traditional Network. You might have used or
seen it enables you to launch resources inside your
own private Cloud. It has features like subnets IP
addressing routing gateways and
flow logs.
Subnets are a range of IP addresses inside your
VPC.
IP addressing allows you to choose either ipv4
or IPv6 addresses for
your endpoints.
routing directs traffic to and from your subnets
and gateways
gateways connect your VPC to other networks
finally flow logs captures traffic in and
out of your interfaces inside your network for auditing
purposes.
Okay. So this is what we want to do in this
video. We'll review the VPC resource inside the
AWS console. We will use search and discover
some of the attributes that make up a VPC after that.
We'll head over to a terminal and open up the VPC terraform
file. Let's get started.
Okay, here we are over on AWS console
once again, and since this
video is gonna be about VPC. We're gonna
first go up to the search bar. And then we're going to type in
VPC to find our component as you
see here. It's the top result.
Click it.
Here we are on vpc's main page where you can
see all the network components that are associated with
the VPC.
Go ahead and click on VPC.
And we'll go into the VPC Details page.
Okay, this is the VPC Details page. And as
you can see it's laid out where it shows all your vpcs
for your account here. We only have one and this
one was created from Amazon when our account was set
up because you need a single default VPC when your
accounts created.
Me open this up a little more so you can see the ID here. You have
a VPC ID. This is unique to this VPC.
We can see the state it's available. And then here we
see the ipv4 side range. So this is the IP
address range that Amazon has provided for
this VPC. And as you can see here, it's a slash 16, which
means we have about 65,534 IP
addresses we can use
All within this virtual Network, obviously you may
or may not use all of them. But you do have them there if you want
and I recommend you always take the slash 16 when creating a VPC.
Over here we have this DHCP option. Basically what
this means for this VPC is that addresses will
be automatically given to Virtual instances when
they ask for it.
So up here in the top, right you'll see orange button
that says create VPC and next to it.
There's an action buttons, which is dropdown. The create VPC
button is here how you would create your own VPC?
From the AWS console. Obviously, we're not going to do that here
because we're going to use some terraform in a
later video to create our infrastructure for us.
but if you wanted to edit
a VPC or let's say delete a VPC you can
use this actions drop-down and select your
appropriate option there.
So one thing that apis console provides you
also too is like kind of like a details drill down.
And so if you click on the little checkbox right
there on the component you want to look at you can
see here. It opens up this other this Details page. It opens
up this details paint and here we see a bunch
of attributes and some tabs. You can click up here. There's a
lot going on here. We won't go into all of
it, but I want you to know where it is available if you wanted to
dive deeper.
So the first thing we should talk about here is the tenancy and it's set
as default what this means is that this VPC
and all the resources inside are okay running
on shared hardware shared hardware means that multiple customers
can use the same physical hardware and obviously for
our use case. This is fine here.
The other option which is important to discuss
here as well is that we have DNS host names
enabled.
With this means is that if you had multiple virtual instances running
inside this VPC and they had
their own fully qualified domain name. You
can find you can reach the other
instance by just using the full qualified domain
name instead of just a regular IP address. This is
a good option to always turn on.
Here, we already talked about the side range above and then the
DHCP option is set. The next thing we should talk about up here
is this tab is called resource map. So this is actually a new feature
that Amazon is implemented here and what this
basically does is shows you a relationship between all
your network components and
you could see that the solid lines here represent relationships.
Whereas the dotted line Show Network traffic. This
is pretty handy if you wanted to see
If you had everything set up, right or if your traffic
was flowing in there correct way.
Is this cider tab here? And as we already talked about this is going to
be our slash 16 for all of our subnet here for the default ours
is gonna be a slash 16 as well when we create it.
Here's the flow logs. This is great. If you need to capture
a network traffic in and out of your VPC based
on auditing purposes
or any anything else like compliance reasons and or
troubleshooting. This would be a good thing to have it tags are
great way to add a human
readable name or a group to some sort
of Amazon resource. This is really great. When you're looking for
things and you want to group like things together or have more
of a human readable name to it instead of these IDs which
obviously gonna be hard enough to remember. Okay. So
that is the basic overview of VPC inside
the AWS console now, we'll head back over
to the terminal and then let's look at the terraform Fallout actually create
all this one when that time comes for our lab.
Okay, here we are inside the terminal. I am
inside the Clone repository that is
in the prerequisites for this course. If you haven't clone
the repository now now would be a good time to stop
the video and just go ahead and do that and come back.
So inside this repository if
we take a look you can see that there's a lab terraform subdirectory.
This is going to have all of our infrastructure's code
files. So let's go ahead and go in there now.
And let's go ahead and list all the files inside
of this directory as you
can see everything with terraform has
a DOT tfn to it.
And that basically is the the files that we're
going to use to create the infrastructure for
our lab. But for this video, we're
just gonna Focus right now on the VPC terraform file.
So go ahead and open that up in your whatever editor you
like.
And it's the vpc.tf file and let's
open this up. Okay, so as you can see terraform looks
Kind of like any kind of program language. You probably
used to you have some curly braces. You've got
some.
Equal declarations and you know, you've got some
structure here that to look at so the basic flow of
creating this module or creating
this resource if you will is this
declaration called resource right here and this is a terraform keyword.
Here this this AWS VPC in the middle is
basically telling you that this is the library it's using
called AWS VPC. This Library knows how to
talk to Amazon and knows how to create a VPC and with
infrastructures code. You don't really care how it gets
done. You just want this as to be the state you end
up with.
And here we just named this resource lab VPC, obviously
we want to be able to find this and they
use a human readable name.
Here we set our cider block as you can tell this is a 10.0
instead of the 172 from the default. And this is
not by accident. You do not want to have overlapping
IP address ranges in separate
vpcs for obvious reasons. And so I'm
just using the 10.0 / 16 here.
So we get the full 65,534 addresses
to use.
And if you remember in the AWS terminal on line
three here, we have enabled DNS host names.
And we have this set to true as as
a native as console. We want to be able to find our virtual
instances by the fully qualified domain name if we wanted
to.
Here on line four we have instance tenancy and here
it is default as well. Just like we saw in the default
VPC up in the console and obviously because
we're okay with being on shared hardware.
So here is the tags where I was talking about. This is a really
good habit to get into is putting tags in all
your resources. So they're easy to find inside AWS and
here we set a key of name.
And then the value lab -
VPC that name can be anything here. I just called it
lab VPC just so as easy to find.
All right. So there's a quick brief overview of the terraform file
that will create our VPC in AWS moment
when it's time for our lab.
For now, we're all set here. So just go ahead and close
the file.
In this video you learned all about vpcs and
VPC features like subnets and routing you navigated to
the VPC console inside ws and you explore
the default VPC that AWS created for you.
Finally you review the terraform file that will create
the VPC in your lab.
In the next video, we will continue our path with AWS foundations
and learn what subnets and Route tables are.
See you soon.