Instructor: So now let's talk about VPC peering.
So the idea is that we can create VPCs
and in different regions, different accounts,
and we want to connect them together using the AWS network.
So to why do we do this?
Well, we want to make them behave
as if they were in the same network, okay?
So it could be very specific.
Maybe you could have a BC in other regions,
in other accounts,
or even within your same accounts
and you wanted to connect them.
So in order for them not to connect, remember I said,
the VPC network CIDRs is,
must be distinct from each other because when we connect
them together, if they have overlapping centers,
they will not be able to communicate.
So VPC Peering can happen between two VPCs
and they're not transitive.
That means that each VPC that wants to communicate
with one another must have VPC Peering enabled.
So if you have a look at 3D PCs right now, A, B, and C,
then we can create a peering connection between A and B
and this is allowing you to connect them together.
And we can create another peering connection between B and C
and again, they can communicate together,
but even though A and B and B and C are connected,
you still need to enable a VPC Peering connection
between A and C to have them communicate.
This is very, very, very, very important.
Also, when you have VPC Peering,
you must enable share sure,
but you also need to ability to update the root tables
in VPC subnets to ensure that the EC2 instances
can communicate with each other
and we'll see this in the hands-on.
So some good things to know about VPC Peering.
They can happen within your own accounts,
but they can cross account.
So if you want to connect a VPC from one accounts
A to account B, you could, and also cross regions.
So this is very, very powerful.
And you remember security groups.
We can reference other security groups in it
while it's possible to also reference a security group
from appeared VBC across accounts in the same region.
And this is very powerful because we don't need to have
the source as a CIDR or an IP,
we can also reference a security group.
Extremely powerful.
So back into our networking diagram,
we're here and now we're going to add
a VPC Peering connection to connect our VPC to other VPCs.
So that's it, I will see you in the next lecture.