SSH wrapper for aws to make your life easier.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
.gitignore
.travis.yml
LICENSE
Makefile
README.md
sawsh.go
sawsh_test.go
util.go

README.md

sawsh

FOSSA Status Build Status

SSH wrapper for aws to make your life easier.

Features

  • Lookup AWS EC2 instances by name.
  • Lookup ip by ip-xxx.xxx.xxx.xxx format.
  • Transparant connect to ip

Usage

$ 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
+---+--------------------+-------------+-------------------------------+
|   |        NAME        |      IP     |          LAUNCHTIME           |
+---+--------------------+-------------+-------------------------------+
| 0 | prod-webserver-1   | 10.1.1.10   | 2018-02-01 21:13:44 +0000 UTC |
| 1 | prod-webserver-2   | 10.1.2.10   | 2018-03-15 18:57:02 +0000 UTC |
| 2 | prod-webserver-3   | 10.1.3.10   | 2018-04-19 18:04:07 +0000 UTC |
| 3 | prod-webserver-4   | 10.1.1.11   | 2018-02-15 12:36:45 +0000 UTC |
| 4 | prod-webserver-5   | 10.1.2.11   | 2018-06-07 15:54:00 +0000 UTC |
| 5 | prod-webserver-6   | 10.1.3.11   | 2018-06-07 15:54:00 +0000 UTC |
+---+--------------------+-------------|-------------------------------+
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:
     connect  Search and connect to an instance
     exec     Search and execute a command on multiple servers
     list     Render a list of instances
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --aws-region value  (default: "us-east-1")
   --help, -h          show help

COPYRIGHT:
   (c) Dries De Peuter <dries@depeuter.io>

Install

Official release

Download the latest release.

curl -sL http://bit.ly/get-sawsh | bash

Build from source

$ git clone https://github.com/NoUseFreak/sawsh.git
$ cd sawsh
$ make
$ make install

Upgrade

To upgrade to the latest repeat the install step.

Configure

Setup sure your aws-cli is setup. That user needs ec2:Describe* permissions.

Suggestion

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'

License

FOSSA Status