Skip to content

Instantly share code, notes, and snippets.

@jefferson
Forked from jonyt/connect_heroku_to_amazon_rds
Created February 17, 2017 18:32
Show Gist options
  • Save jefferson/d6cb3a7468b0553c34fd2a936c978560 to your computer and use it in GitHub Desktop.
Save jefferson/d6cb3a7468b0553c34fd2a936c978560 to your computer and use it in GitHub Desktop.
How to connect a Heroku application to an Amazon RDS Postgresql instance
Download the certificate with:
`wget -O config/rds-combined-ca-bundle.pem http://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem`
Then connect with:
`postgres://user:password@amazon-host/db_name?sslmode=require&sslrootcert=config/rds-combined-ca-bundle.pem`
References:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL
https://github.com/jeremyevans/sequel/issues/897
http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT
http://dba.stackexchange.com/questions/77811/how-to-connect-to-an-amazon-postgresql-database-using-ssl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment