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 ENVIRONMENT where ENVIRONMENT here is our prod environment (stonks-env). You need an IAM access key & secret here ,contact @willyspinner if you need one.
  2. Install the postgresql client on the beanstalk AMI machine - sudo yum install -y postgresql
  3. Get the PG_CONNSTR connection string (you can see this in beanstalk - I'm not going to post it here for security reasons) and simply run psql "$PG_CONNSTR" to access the database.

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