Coder Social home page Coder Social logo

ish's Introduction

ish

example

Instance-SSH ...ish.

Build Status

ish connects you to a server in your AWS account based on properties of the server. Notably useful when you don't care which server exactly, just a server of a particular type.

Currently you can connect to servers based on their:

  • name tag
  • environment tag
  • instance id
  • autoscaling group membership
  • opsworks instance name (oin)
  • opsworks stack name (ois)
  • image id (AMI)

If more than one server matches the attribute, it will pick one and connect you to it.

If you pass additional parameters, they will get appended to the ssh command.

In the example command, /usr/bin/ssh ip_address echo "hello_there" is the run command:

$ ish name:openvpn echo "hello there"
hello there

ish also supports autocompletion (read below.)

Installation

You can install via:

  • setuptools using python3 setup.py install and source the contrib/ish-autocomplete script.
  • Homebrew using brew install https://raw.githubusercontent.com/grahamc/ish/master/ish.rb

Details

Caching

To improve performance, instance metadata is stored in $HOME/.ish.json. This file should be automatically replaced if it is over 60 seconds old, but delete it if you experience issues.

AWS Configuration

ish uses boto3 which uses the standard AWS configuration stack. Read more here: https://boto3.readthedocs.org/en/latest/guide/configuration.html#configuration-sources

SSH Configuration

The command run is ssh IP. If you want to set additional configuration settings, please use your ~/.ssh/config.

An example SSH configuration might be

Host 172.*
    StrictHostKeyChecking no
    IdentityFile ~/.ssh/keys/aws-keys
    User yourusername

ish connects to the private instance IP

You might find this article helpful if you use a bastion / jump-host instead of a VPN: http://edgeofsanity.net/article/2012/10/15/ssh-leap-frog.html

Autocomplete

A full list of supported targets can be found with ish --completion, and a bash and zsh compatible autocomplete script is found in ./contrib/.

Auto-completing targets with spaces in them

Targets with spaces in them must be quoted, but will be autocompleted without them. Example:

$ ish name:Logstash Ingestion

Contributing

  • flake8 must pass with no exceptions
  • coverage must report 100% coverage
  • it must run perfectly on python 3, python 2 is not supported.

ish's People

Contributors

grahamc avatar parambirs avatar simplesteph avatar zeridon avatar

Watchers

James Cloos avatar fala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.