.net – Can’t connect Amazon rds database in Amazon ec2

amazon-rdsamazon-web-servicesnet

I have a console application that has Amazon rds connection with Entity Framework . It is running well in my local PC. But When I am running my application in Amazon EC2 It can not connect to my Amazon RDS database and saying 'The underlying provider failed on open' . My connection string of entity framework is …

<add name="MyEntities" connectionString="metadata=res://*/YhFinModel.csdl|res://*/YhFinModel.ssdl|res://*/YhFinModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=datasourcename,portnumber;initial catalog=databasename;persist security info=True;user id=userid;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Thanks in advance.

Best Answer

Have you looked at your security groups? I think you will need to add the EC2 security group you are using to have port access to your RDS instance.

Related Topic