Skip to content

How to access our production database

Wilson Jusuf edited this page Jan 22, 2021 · 4 revisions

Here are the steps to ssh into our RDS instance.

The RDS instance is publicly inaccessible but is under the same VPC & security group as the beanstalk instance. What we have to do is to ssh into the beanstalk instance (the 'jumphost'), and access the database from there.

Steps:

  1. ssh into the elastic beanstalk instance by using eb ssh stonks-env. You need an IAM access key & secret here ,contact @willyspinner if you need one.

  2. Install the postgresql client on the beanstalk instance - sudo yum install -y postgresql

  3. Get the PG_CONNSTR connection string and simply run psql "$PG_CONNSTR" to access the database. To get this string, simply run /opt/elasticbeanstalk/bin/get-config environment in the Beanstalk instance and you'll see it.

This isn't the most optimal way to do it for sure, so any suggestions to improve it, let us know!

Clone this wiki locally