Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A DB Instance in a VPC Accessed by an EC2 Instance in a Different VPC

I'm confronting with a problem in my enviroment. I have two VPCs (A - B): - An ec2 instance is based on the first one (VPC A). - A RDS is based on the second one (VPC B).

And I have two questions :

  • How can I access to my RDS by EC2 base in a different VPC ?

  • I found two ways but, what is the differences between a Transit Gateway and VPC Peering and what is the best way ?

Thank you per advance

Best

like image 256
Anthony PALERMO Avatar asked Nov 25 '25 04:11

Anthony PALERMO


1 Answers

  • VPC peering is the best choice if you have small infra.

  • Both are used to establish connectivity between multiple VPC's but the main difference is Transit Gateway can establish connectivity between multiple VPC's and with multiple on-premise Datacenter's. The other disadvantage with VPC peering is that when we have number VPC's we need to do VPC peering with each and every VPC which becomes a mesh. But with Transit Gateway, we can just create one Transit Gateway and connect many VPC's and on-premise Datacenter. Here is the detailed architecture digram that explains better.

enter image description here

For more detailed steps, I would suggest you watch this re:invent video

like image 125
sudheerchamarthi Avatar answered Nov 27 '25 00:11

sudheerchamarthi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!