ec2ssh

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: MIT Imports: 21 Imported by: 0

README

ec2ssh

Go wrapper around SSH that speaks AWS API

Installation

$ GO111MODULE=on go get github.com/adhocteam/ec2ssh

to upgrade your ec2ssh version, do:

$ GO111MODULE=on go get -u github.com/adhocteam/ec2ssh

Usage

Connecting
# by AWS instance ID
$ ec2ssh i-0017c8b3

# by the instance Name tag
$ ec2ssh api-server

# by the instance private IP address
$ ec2ssh 1.2.3.4
Other options/flags

Specify an AWS profile other than "default":

$ AWS_PROFILE=altprofile ec2ssh

Specify an AWS region other than "us-east-1":

$ AWS_REGION=us-west-2 ec2ssh

See a list of running/pending instance names and ids:

$ ec2ssh --list

Run a command on a remote server:

$ ec2ssh -c 'echo bananas' <remote-server-name>

Notes

  • Assumes you have at least one AWS profile configured. See AWS docs for details.
  • The tool assumes you keep all SSH keys in $HOME/.ssh/, and match the key name assigned to the EC2 instance. Use -p or AWS_KEY_DIR to specify an alternate path to your private keys.
  • The GO111MODULE=on bit is due to some clunky behavior in go, you can follow this ticket to see when it gets fixed

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL