To establish load balancing between two VPCs (Virtual Private Clouds) in AWS (Amazon Web Services), you can use an Application Load Balancer (ALB) or Network Load Balancer (NLB) combined with VPC peering.
Create VPC-1:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824593216/0836b4cd-3a9b-496f-905f-66b02236486c.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824725247/4078fdd6-3864-4ad6-97bf-53d800ddcb4e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824761068/d2280409-ce1e-40ec-8937-6cf166d9b94a.png)
Create Subnet1:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824800255/ef59a95e-3fcc-41ef-be6e-ee8553b479f6.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824831881/3574d59c-1139-40d1-8fe0-9ae59a066815.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824961700/7c092050-eac9-41cf-bd27-eb50ad7f459e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684824993465/4a0ce054-e4d4-46fb-8c31-15fd2bb04d53.png)
Create Subnet2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825112337/64060e4d-d586-41ac-aba5-ef788f00d41a.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825153770/8d301c00-2bba-47c6-9f62-32f8baf3e61d.png)
Create Internet Gateway-IGW:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825855763/660cbb05-27dc-4725-bc6c-a7e7e27dbe33.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825893533/76241f9d-370b-4829-8b63-8f095e345d01.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825921113/7aaeb622-151c-481a-ba69-fca74d758835.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825965159/1c61ac37-ab5d-4926-95d1-b5268a8b3980.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684825991663/67a09603-d735-433b-8895-a273a6329a8d.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826014505/476a165e-c3fc-488d-94d2-ae3df70ebdf6.png)
Add route in vpc1-default:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826094384/7f9f8584-04af-4e87-b199-780085c29217.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826182022/9d760ba1-d90b-4bf5-b0b6-bf2967ec3cf8.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826210610/83f2c370-e72d-423f-9aef-d55f29659f18.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826238780/9c4c518a-2a56-43d7-9249-773efea97fc3.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826252445/277ecdda-4b03-4aae-9fbf-a6c67c5ffd2d.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826301263/8d35182b-f268-4598-94f3-cd1ccb5a4dcf.png)
Create VPC-2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826453912/8cdba1ab-89fc-4826-85cd-098362221b02.png)
Subnet create in vpc2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826621717/cdf8bae2-e60b-40e2-a3be-fcb3e10d1574.png)
IGW Created for vpc2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826805998/e05611a5-5f23-4c72-bdba-5650d49937b9.png)
Route added in vpc2 igw2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684826931981/3eab9435-42a9-4b9f-838c-02b937e689dc.png)
Create a Peering Connection Between VPC1-VPC2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827012060/fc80a1d8-23ad-4514-a19b-1de83012beb0.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827067952/17858167-4b56-4480-9475-b7cf4efef0a6.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827104314/70ece28f-118c-4765-ac62-ece81fbbe695.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827189106/d9e29fd9-d553-4ba8-a26f-2cae3cdc5118.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827228877/479fd53a-75ab-4f98-a996-93531151b98b.png)
Now inform the routes about the vpc1 and vpc2 path to connect and communicate:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827415125/f95564ef-9420-40ea-a717-985d564d4609.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827458448/1cff9dcc-b8ae-43b7-8cd7-23e2581a044f.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827472643/0f9da587-3f20-4f3a-99bd-ed37c74f9dbc.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827731712/f361b5ab-a60d-4207-b343-3f8eaa179fa5.png)
Apply the same procedure for vpc2 and add the vpc1 path.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684827670933/9e819aa9-6df0-4150-aba3-180c6423bf36.png)
Three instances were created for vpc1/vpc2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684828771011/490d0362-9b8d-4d1d-8450-fbde49c9ea7c.png)
Configure ELB-APPLICATION between VPC1-VPC2:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830518860/43791127-bb36-4c6d-81b8-9b1b7bfd864c.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830611178/b5c12957-8b2c-4392-9ba2-3690797a62c7.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830629332/1b020fc8-0d97-4e0a-adb7-34046abdc677.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830665387/4b3b8595-f45b-401d-8b8b-3f29799be702.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830699245/bb617b1d-f4c8-4fda-b1e9-782676331a94.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830717886/c875250b-6c51-487a-8891-aa031d105508.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830738225/b831e36d-40e4-4114-8945-6e557d253412.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830806445/379e532b-d19b-41a4-80a0-b54f56881670.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830912440/497edb92-ee0f-4748-a503-8ea83e920fb5.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684830926458/88b40094-b980-4512-ac64-18952ae4d6a8.png)
Register vpc instance target in ELB.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831021007/09210453-2d64-4d52-ba32-1b9b822f264d.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831039218/b22eb2c8-12ab-45ce-9ce2-61fce492b846.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831077587/86a85d30-4341-4f26-8cd9-cf4ab7c51cd2.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831109548/1d525d5e-9099-4a6b-99d2-0f0cf7672660.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831129934/5d2390af-a71b-4381-8b7e-948baaf36049.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831226044/4831f954-7569-4eca-8f5c-eebe494a1991.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831894768/16d22a8d-9d41-4b2b-a6d2-e40e72bd2b6e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831920536/f27294ab-0706-40ff-9e2c-7979ddc3951c.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684831934038/9f377de1-766f-4891-a895-d7e1a8847f69.png)
End Of Lab – Good Luck!!!
No comments:
Post a Comment