pmazurek / aws-fuzzy-finder

:zap: SSH into instances using fuzzy search.
MIT License
129 stars 27 forks source link

Support psql to RDS instance #10

Closed jlee-made closed 7 years ago

jlee-made commented 8 years ago

Would be great if it let you psql (or msql) to RDS instances in a similar way to what you already do for ssh to EC2 instances.

I currently do this with a script that ssh's to a hard-coded host (whose IP it fetches from AWS) and runs psql there. There are two AWS names involved in that (EC2 host to ssh to, and RDS host) -- don't know best way to handle that, perhaps finding a suitable EC2 host can be automated...

pmazurek commented 7 years ago

Hmm, this can be achieved by using the command template env var: https://github.com/pmazurek/aws-fuzzy-finder/blob/master/aws_fuzzy_finder/settings.py#L13 and perhaps combining it with an alias like:

alias fuzzypsql="AWS_FUZZ_SSH_COMMAND_TEMLPATE='psql -h {host} -U user' aws-fuzzy"

This makes me think that the command template variable name should not contain the word "SSH", afterall its quite flexible.