Home > Back-end >  AWS EC2 connects to RDS inside VPC without passing throught Internet
AWS EC2 connects to RDS inside VPC without passing throught Internet

Time:10-01

In AWS VPC I have an RDS instance with endpoint xxxname.xxxcode.eu-south-1.rds.amazonaws.com.

If an EC2 instance in a public subnet in the same VPC connects to that RDS instance, is traffic going throught Internet or staying inside AWS network? Being the RDS instance publicly accessible is relevant to that?

Do I need an Interface VPC endpoint to route traffic to RDS instance without going throught Internet?

If yes, being the Interface VPC endpoint something like vpce-xxxcode.rds.eu-south-1.vpce.amazonaws.com, what will be the endpoint to my RDS instance to privately connect?

CodePudding user response:

If the RDS instance is in the same VPC, the endpoint name will resolve to an IP address internal to the VPC. When your EC2 instance connects to the RDS, it will use the VPC DNS resolver and will use the resolved private address. The connection will not be made over the public Internet.

  • Related