Amazon VPC is a service that helps you launch AWS resources in a logically isolated virtual network you define. You have complete control over your virtual networking environment.
Basically, VPCs are usually isolated from each other. A VPC Peering connection is a networking connection between two VPCs that you can use to route traffic between them by using private IP addresses.
A critical property of a subnet is its route table. Which usually contains a set of rules, called Routes, Routes determine where network traffic, from your subnet or gateway is directed.
After selecting the Peering Connections, Your VPC will request that another VPC allow access to its resources. The VPC that makes the request is called the Requester. You can request access to VPCs from other AWS Accounts.
When a VPC peering is created, you have to accept it to activate, if the peering connection is across accounts both accounts must accept the connections to activate it.
After a connection is established you must modify the route table associated with each VPC. You must add a route into each route table to allow traffic to be routed to the peered VPC.
Even after creating a VPC connection, peered VPCs do not necessarily accept all data between them. Security features like network access control lists and security groups still apply, and you need to update them. You need to configure the CIDR and specify.
https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html
It is important that when we have multiple VPCs, then VPC peering would not be an appropriate use case in this instance, but we can achieve peering with #TRANSIT GATEWAY
-
CIDR Marketing 10.10.0.0/16 Requester Marketing VPC
-
CIDR Finance 172.31.0.0/16 Accepter Finance VPC
-
CIDR Developer 192.168.0.0/20
-
Private ipv4 of Finance
-
Click Subnet ID of Marketing
-
Click Route Table
-
Click Route
-
VPC peering
-
Marketing EC2 >> SubnetID >> Route table
-
Add finaance CIDR TO Marketing >> mArkrting to Finance
Try connecting
-
Finance server >> Security Group
-
Inbound Rules >> Custom ICMP >> Add Marketing CIDR.