Connect to a RDS SQL Server instance from website deployed on AWS EC2 instance "Elasticbeanstalk"

I have created an RDS SQL Server instance and I am able to access from my local machine because of localhost.

But when I deploy the same website on elasticbeanstalk.com, it does not connect to the database because of some permission issues


Issue resolved. I added an inbound rule for a security group that is used for RDS db instance.

Added port range from min to max and IP source to "0.0.0.0/0" for all TCP.