0
votes

I am new to VPC and Security Group Concepts in AWS.

In my project, there is one EC2 box which is associated with VPC_1 , Security Groups: SG_1 and SG_2 and subnet id: SUBNET1. In this box MySQL database is running.

There is another EC2 box which is associated with VPC_2, Security Groups: SG_3 and SG_4 and subnet id: SUBNET2. Here application is going to run from which I would like to query the MySQL database as mentioned above.

Could anyone please give any pointers regarding this ? Thanks.

1

1 Answers

1
votes

There are two ways by which you can access DB from app

  • With VPC peering (preferable)

    Peer both VPC's and whitelist the private app subnet range in db security group.

  • Public DB instance

    Boot the DB in public subnet with public IP and whitelist your app VPC_2 NAT IP(s) in db security group, while using RDS, there is publicly accessible option, need to enable it