Multiple methods exist in AWS for establishing connectivity between VPCs; Transit gateway, VPC Peering, and Private Link.
It can be hard to pair up multiple VPCs; see: How to Enable Peering Between Multiple (Inter-Region) VPCs via Transit Gateway?
VPC Lattice makes it easier to pair up multiple VPCs.
Two remarkable features of the VPC Lattice are:
- You need not be concerned about overlapping IP addresses between VPCs.
- As the traffic is internal between VPCs, you do not need to modify the route table.
I’ve created two EC2 instances: Payment-server and Email-server
Both have public addresses, and anyone can access their Port 80 from anywhere.
They have the same private IP address.
They reside in distinct VPCs.
I sent a request from my local computer to each instance:
VPC Lattice can be used to set up a connection between them
Click “Target groups” under the VPC Lattice section of the VPC Console.
Click “Create target group“.
I added email-server to the target:
Click “Create Target group”.
You should be redirected to the email-target overview:
Follow the same steps for the payment-server
Now, return to the VPC Console, and under the VPC Lattice section, click “Services”:
Click “Create service”. Specify a service name:
Click “Next” on the next page (the Define routing page).
Click “Next” on the next page (the Create network associations page).
Click “Create VPC Lattice Service” on the next page (the Review and create page).
This is how the email-svc overview should look:
Follow the same steps for the payment service
Now, go back to the VPC Console and click “Service networks” under the VPC Lattice section:
Click “Create service network”. Create a service network as follows:
The summary should look as follows:
Click “Create service network”
This is how the summary of the service network should look:
Go to the payment-svc overview and Click “Routing”:
Click “Add listener”:
Set a listener:
Follow the same steps for the email-svc
Return to the payment-svc overview and copy the domain name:
The VPC Lattice configurations have been completed. Let’s see how the setup works.
Let’s attempt to access the VPC Lattice domains from the EC2 instances:
What are the VPC Lattice domains’ DNS addresses?
This IP address is in the reserved range of IPv4 Link-local addresses (what is it?)