LoginSignup
0
0

More than 5 years have passed since last update.

Amazon RDSの情報からmysql_config_editorを一気に設定するスニペット

Posted at

AWS CLIとJQを使ってmysql_config_editorのコマンドを生成するスニペットです。
PWは自分で入れる感じです。

$ aws rds describe-db-instances | jq -r '.DBInstances[] | ["mysql_config_editor set", "--login_path="+.DBInstanceIdentifier, "--host="+.Endpoint.Address, "--user="+.MasterUsername, "--password"] | join(" ")' | xargs -I{} sh -c 'echo {}; {}'
mysql_config_editor set --login_path=hogedb --host=hogedb.aaaaaaaa.ap-northeast-1.rds.amazonaws.com --user=masteruser --password
Enter password:
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0