Skip to content
This repository has been archived by the owner on Nov 18, 2017. It is now read-only.

Latest commit

 

History

History
59 lines (40 loc) · 1.27 KB

README.rst

File metadata and controls

59 lines (40 loc) · 1.27 KB

ec2-ssh

https://travis-ci.org/YPlan/ec2-ssh.svg?branch=master

A pair of command line utilities for finding and SSH-ing into your Amazon EC2 instances by tag (such as 'Name').

Forked from Instagram original code by YPlan.

Installation

From pip:

pip install ec2-ssh

Usage

# ec2-ssh

% ec2-ssh nginx2
# equivalent to
# ssh [email protected]

% ec2-ssh root@appserver
% ec2-ssh deploy@nginx2 sudo restart nginx

# Specifying the user with an environment variable
% EC2_SSH_USER=deploy ec2-ssh nginx2

# ec2-host

# w/o arg: prints all active instances
% ec2-host
ec2-123-45-67-89.compute-1.amazonaws.com
ec2-132-45-67-89.compute-1.amazonaws.com
ec2-231-45-67-89.compute-1.amazonaws.com

# w/ arg
% ec2-host backend
ec2-132-45-67-89.compute-1.amazonaws.com
ec2-132-45-67-90.compute-1.amazonaws.com

# w/ tag arg too
% ec2-host -t environment production
ec2-132-45-67-90.compute-1.amazonaws.com
ec2-111-45-67-90.compute-1.amazonaws.com