-
Notifications
You must be signed in to change notification settings - Fork 2
How to access our production database
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.
-
ssh
into the elastic beanstalk instance by usingeb ssh stonks-env
. You need an IAM access key & secret here ,contact @willyspinner if you need one. -
Install the postgresql client on the beanstalk instance -
sudo yum install -y postgresql
-
Get the
PG_CONNSTR
connection string and simply runpsql "$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!