Skip to main content

A simple AWS ec2 host discovery and ssh script

Project description

ssh-ec2

Make ssh to EC2 instances easier

Install:

pip install ssh-ec2

Setup:

Add the following to your shell rc (.bashrc, .bash_profile, .zshrc):

#compdef ssh_ec2
_ssh_ec2() {
  eval $(env COMMANDLINE="${words[1,$CURRENT]}" _SSH_EC2_COMPLETE=complete-zsh  ssh_ec2)
}
if [[ "$(basename -- ${(%):-%x})" != "_ssh_ec2" ]]; then
  autoload -U compinit && compinit
  compdef _ssh_ec2 ssh_ec2
fi

Example Usage:

ssh_ec2 select [TAG NAME] [TAG VALUE] [IP ADDRESS|all|random]

Usage: ssh_ec2 [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  select

Tab completion for all commands and arguments. If you don't need a specific IP then use random to select one of the hosts at random or all to go to each host in turn.

Note:

If tag names have a : in them they are replaced with _COLON_ this is due to zsh treating text after a colon as help text

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssh-ec2-0.0.2.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

ssh_ec2-0.0.2-py3-none-any.whl (16.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page