I need to point my Heroku application to my AWS RDS database. My RDS database is up and running and has a security group with 0.0.0.0/0 access.
Currently, I\'ve rem
The following steps worked for me (Feb 2017), given the following setup:
heroku-app-stage)stage)postgresql://username:password@awsrdshost:5432/dbnameThere are broadly four steps to this:
Download and install Amazon RDS SSL root certificate
git push stage master)heroku run bash --app heroku-app-stage to see your files in the dyno)Configure Heroku to refer to root certificate
heroku-app-stage, go to Settings tab, and click on Reveal Config Vars?sslrootcert=rds-combined-ca-bundle.pem&sslmode=require. The new value should now be postgresql://username:password@awsrdshost:5432/dbname?sslrootcert=rds-combined-ca-bundle.pem&sslmode=requireNote that this answer uses a root certificate; there may be other options which may be what you want in which case refer to the following SO:
How to connect to a remote PostgreSQL database with Python
Enable SSL on your RDS instance
psql postgres -h awsrdshost -p 5432 -U username, you should see SSL in the connection detailsConfigure RDS security group to allow all incoming IP ranges
Note: instructions are only relevant if you're using an RDS setup that uses VPC Security Groups
That's it!
Links to the reference pages used:
Amazon's guide to SSL on Postgres http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL
Heroku's (very short) guide to Amazon RDS https://devcenter.heroku.com/articles/amazon-rds