SSH wrapper for aws to make your life easier.
- Lookup AWS EC2 instances by name.
- Lookup ip by
ip-xxx.xxx.xxx.xxx
format. - Transparant connect to ip
$ sawsh webserver
This example will query AWS for a EC2 instance containing the name webserver
. It will prompt you with a choise when
more than one result is found.
$ sawsh webserver
listing instances with tag core in: us-east-1
+---+--------------------+-------------+
| | NAME | IP |
+---+--------------------+-------------+
| 0 | prod-webserver-1 | 10.1.1.10 |
| 1 | prod-webserver-2 | 10.1.2.10 |
| 2 | prod-webserver-3 | 10.1.3.10 |
| 3 | prod-webserver-4 | 10.1.1.11 |
| 4 | prod-webserver-5 | 10.1.2.11 |
| 5 | prod-webserver-6 | 10.1.3.11 |
+---+--------------------+-------------+
Pick a number: 1
Connecting to 10.1.2.10 ...
$ sawsh -h
NAME:
sawsh - Query and connect to ec2 instances
USAGE:
sawsh [global options] command [command options] [filter]
COMMANDS:
list Render a list of instances
connect Search and connect to an instance
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
COPYRIGHT:
(c) Dries De Peuter <dries@depeuter.io>
Download the latest release.
$ wget https://github.com/NoUseFreak/sawsh/releases/download/0.1.0/darwin_amd64.tar.gz -O - | tar -xz
$ sudo mv ./sawsh /usr/local/bin/sawsh
$ git clone https://github.com/NoUseFreak/sawsh.git
$ cd sawsh
$ make
$ make install
To upgrade to the latest repeat the install step.
Setup sure your aws-cli is setup. That user needs ec2:Describe*
permissions.
It may be useful to setup some aliases if you use multiple aws accounts or want it to run with a non standard profile.
$ alias prod_ssh='AWS_PROFILE=prod sawsh'