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: