Home > other >  How do I share an RDS database to another VPC without allowing the peered VPC to access everything e
How do I share an RDS database to another VPC without allowing the peered VPC to access everything e

Time:12-09

I have an RDS database in VPC A, that I'd like to share with an EC2 instance in VPC B.

How do I do so by giving access specifically ONLY to the database (especially given that RDS doesn't expose a static IP and rather a DNS endpoint)?

CodePudding user response:

Assuming your VPCs are peered using VPC peering or transit gateway, you can whitelist ec2's security group in the security group that is attached to your rds instance.

So, you can add an inbound rule to rds's security group which will allow access on port 3306 (mysql) or 5432 (postgres) from security group id attached to ec2 instance.

  • Related