What security group rules should I set for my db instance and my EC2 instance for accessing DB instance from my EC2 instance?
Both are in different VPCs and I used VPC Peering between them.
I did following configuration:
- I created two VPC's
- One is with public subnet and another is with private subnet
- Launch EC2 web instance with public VPC and MySQL db instance with private subnet
- Set VPC peering between them and they both have different security groups
- Created a NAT Gateway in public subnet
So, how should I set both security group rules for establishing connections between them?