ローカル環境のMac OSからAWS上に存在する踏み台サーバ経由でstaging環境へアクセスし、そこからDBへ接続する方法
ローカル → EC2(踏み台) → EC2(Staging) → RDBMS(Mysql)
前提
ローカル環境のMacの.ssh/configに踏み台経由での各サーバへの接続方法を記載
例:
.ssh/config
Host sample-proxy
User user
Port 22
Hostname xxx.xxx.xxx
preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa
Host *sample.jp
User user
port 22
ProxyCommand ssh sample-proxy nc %h %p
preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa
手順
2017年11月13日現在 stable版ではローカルの.ssh/configを読む設定は選択できなさそうです。
EAPだと上記設定が可能な為、設定できるようにします。