Connect to Amazon RDS with SQLAlchemy from Python

1. Create connection with SQLAlchemy

DB_URI = 'mysql://{usr}:{pwd}@127.0.0.1/your_db_name'.format(
    usr='username',
    pwd=‘password'
)

2. SSH tunnel through Bastion

ssh -L 3306:endpoint_of_your_rds_instance.amazonaws.com:3306 
[email protected]

9 Comments

Comments are closed, but trackbacks and pingbacks are open.