I have an EC2 instance with no public IP address and I want it to access my RDS instance. I have put the two instances in the same VPC and subnet. I have tried the following (*) but did not work. Only when I set a public IP address to the Ec2 instance then add it to the security group of the RDS instance that it worked. But that is not what I want since this ec2 instance should be private and not have a public ip.
*tried adding the following to RDS security groups
- private ip address of ec2
- ip 10.0.0.0/32
- security group assigned to ec2