Not able access the RDS instance from the EC2 instance, if we set the publicly access to 'No'. As per my understanding the EC2 instance should be accessible within the network and should be blocked outside network.
Asked
Active
Viewed 58 times
1 Answers
0
Setting your DB instance to 'public' simply allows it to possibly be accessible from the outside. Setting it to no doesn't mean everything in your VPC can access it.
You still need to allows access to this DB instance from your EC2/Beanstalk instances. When editing your DB's security group, open the correct port (3306 for mysql, 5432 for postgres, etc) and give access to the security group that your EC2/beanstalk instances are in.
To put another way, you don't need to (or want to) open access by IP address to your database. Use the security group instead.

tedder42
- 23,519
- 13
- 86
- 102