I have problems connecting to an external Postgresql database on EC2 from my heroku app. The problem seams to be with the permission on EC2.
I have done the following:
– added 098166147350/default for my security group on port 5432 (my postgresql port)
– connect to the site using the “Public DNS”-address (ec2-x-x-x-x.compute-1.amazonaws.com).
The database I try to connect to is in the EU and not US-East region as the heroku app, don’t know if this makes any difference?
Anyway if I add 0.0.0.0/0 to 5432 it does work, so I guess it got to have to be the security settings.
Anyone have any idea what the problem could be?
I got back from heroku support:
Apparently the different i region (us-east (heroku) -> eu (my db)) makes a different in adding a security group like that. So the they suggested a VPN tunnel from us-east on my account to eu. Or just 0.0.0.0/0 and rely on SSL and good passwords.