go-ec2list

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2015 License: MIT Imports: 17 Imported by: 0

README

go-ec2list

Retrieve EC2 instances information from all profiles and all regions concurrently. This tool is intended to use with interactive selection tools like peco or percol.

INSTALLATION

$ go get github.com/sudix/go-ec2list

USAGE

Setup your AWS credential file.

See Configuring the AWS Command Line Interface - AWS Command Line Interface.

Run command

$ go-ec2list

Result

You will get EC2 instances list.
Each line is tab separeted values.

Output Values

  • Instance Name
  • Instance ID
  • Public IP
  • Private IP
  • Profile Name
  • Availability zone
  • Instance type
  • Instance state

Options

Cache

If you set -cachemin option, go-ec2list caches results and uses that until it expires. Value means expire minutes.

USAGE

$ go-ec2list -cachemin 10

The cache is stored to $HOME/.go-ec2list/cache.

Delete cache

When -refresh is specified, the cache will always be deleted and re-create cache regardless of -cachemin option.

USAGE

$ go-ec2list -cachemin 10 -refresh

EXAMPLE USAGE WITH INTERACTIVE SELECTION TOOLS.

Set alias like below, and you can ssh login to the selected instance.

alias ec2="go-ec2list | peco | cut -f3 | xargs -I{} sh -c 'ssh "ec2-user@{}" </dev/tty' ssh"

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