Skip to content

astrostl/aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws

I find looking up IP/key combos in order to SSH into Linux EC2 hosts pretty annoying. Managing multiple AWS accounts takes this to another level. 'aws' (it might expand beyond EC2) seeks to mitigate this. Clone it into your home directory, add your accounts and SSH keys, and fetch the EC2 API tools.

Usage and account list:

# aws
usage: /Users/astrostl/aws/bin/aws [account|account/instance|all] [command|-i]
example1 example2

Displaying "account/nametag: ssh string" for a given account:

# aws example1
example1/example1-web01: ssh -i ~/aws/keys/example1.pem ec2-user@ec2-1-2-3-4.compute-1.amazonaws.com
example1/example1-web02: ssh -i ~/aws/keys/example1.pem ec2-user@ec2-2-3-4-5.compute-1.amazonaws.com

Displaying "account/nametag: ssh string" for ALL accounts:

# aws all
example1/example1-web01: ssh -i ~/aws/keys/example1.pem ec2-user@ec2-1-2-3-4.compute-1.amazonaws.com
example1/example1-web02: ssh -i ~/aws/keys/example1.pem ec2-user@ec2-2-3-4-5.compute-1.amazonaws.com
example2/example2-db01: ssh -i ~/aws/keys/example2.pem ec2-user@ec2-3-4-5-6.compute-1.amazonaws.com
example2/example2-db02: ssh -i ~/aws/keys/example2.pem ec2-user@ec2-4-5-6-7.compute-1.amazonaws.com

Running a command on all instances for a given account (danger!) (this works for the "all" target too):

# aws example2 uname -m
example2/example2-db01: x86_64
example2/example2-db02: x86_64

Running a command on a specific instance in a given account (danger!):

# aws example2/example2-db01 uname -m
example2/example2-db01: x86_64

INTERACTIVE login to a specific instance in a given account:

# aws example2/example2-db01 -i
[ec2-user@domU-00-11-22-33-44-55 ~]$

BONUS: source the script and it will set up a direct API account tool usage env in your current shell

# . ~/aws/bin/aws example1
# ec2-describe-instances

About

Eases SSH management of Linux EC2 Hosts. Supports multiple accounts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages