Here I used the same security group for both ec2 instance as well as db instance I also added mysql/aurora rule to security group