AWS Shortcuts for Command-Line Instance Control
Project description
List, start, stop and ssh to AWS instances using Name, ID and wildcards
AWS Shortcuts (awss) allows listing, starting, stopping and connecting to instances by name, partial names with wilcards, or instance-id. The instance information listed includes: all tags & values, name, current-state, instance-id and image-name.
Conecting via SSH on Windows computers is performed by using the command line version of PuTTY, called plink. On Windows, plink serves as the ssh command, and is run within powershell, so ansi-escape sequences, and colors, are possible.
Overview
awss has the following sub-commands: list, start, stop, and ssh.
SSH to an Instance: awss ssh NAME
Additional paramters described in Command Details.
List Instances: awss list
Additional paramters described in Command Details.
Start Instance: awss start NAME
Stop Instance: awss stop NAME
Example screenshots
“awss list” - list instance details (tag keys are listed in blue)
“awss start” using Name with wildcard -> duplicate results -> selecting target from list
Tested Platforms & Python Versions
Python 2.7, 3.3, 3.4, 3.5, 3.6
Platforms:
Linux
macOS (OS X)
Windows (see Windows Prereqs for ssh functionality)
Installation
This utility can be installed with pip:
pip install awss
Windows Prereqs
Because Wiindows does not have a built-in ssh command, using the awss ssh command on windows requires:
Installation of PuTTY suite
use the “Windows Installer”, install all options, and include it on your path
Converting ssh keys from Amazon’s “.pem” format to “.ppk” format
keys can be converted using the puttygen utility (installed with PuTTY)
Powershell must be on the system (installed by default in recent versions of Windows)
Configuration
SSH Access Keys (.pem files)
Keys should be stored in the .aws folder in your home directory
AWS Credentials can be stored using either one of these two methods:
Environment variables “AWS_ACCESS_KEY_ID”, “AWS_SECRET_ACCESS_KEY” and “AWS_DEFAULT_REGION”
Files named “credentials” and “config” in the .aws folder in your home directory
The Windows home directory is referred to by the environment variable %UserProfile%
{HOME}/.aws/credentials
[default] aws_access_key_id=AKIAIOSFODNN7EXAMPLE aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
{HOME}/.aws/config
[default] region=us-west-2 output=json
Information on AWS Credentials is in the AWS Getting Setup guide.
Information on configuration files in is the AWS Getting Started guide.
Command Details
SSH to Instance: awss ssh NAME or awss ssh -i ID
typing awss ssh without a name or ID will display all running instances
this allows the user to select from the list if they can’t remember the name.
this can be combined with wilcards, for example awss ssh U* to display a list of instances starting with “U” to select from.
the login-name is automatically calculated based on the image-type of the instance
override the calculated login-name -u USERNAME
connect without PEM keys (if properly configured) -p
command specific help awss ssh -h
List Instances: awss list
list all instances (default), or use wilcards awss list D*
list running instances -r or –running
list stopped instances -s or –stopped
list instances with specified name awss list NAME
list instance with specified instance-id awss list -i ID
instance-state and NAME may be combined in queries.
ex: list instances with NAME currently running: awss list NAME -r
command specific help awss list -h
Start Instance: awss start NAME or awss start -i ID
typing awss start without a name or ID will display all stopped instances
this allows the user to select from the list if they can’t remember the name.
this can be combined with wilcards, for example awss start U* to display a list of instances starting with “U” to select from.
start instance by name or instance-id
command specific help awss start -h
Stop Instance: awss stop NAME or awss stop -i ID
typing awss stop without a name or ID will display all running instances
this allows the user to select from the list if they can’t remember the name.
this can be combined with wilcards, for example awss stop U* to display a list of instances starting with “U” to select from.
start instance by name or instance-id
command specific help awss stop -h
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for awss-0.9.11-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a1813325d7408651ab43e74773805fd38dff1595c50e668c9c0a3db9281ed60 |
|
MD5 | 554bb59cea648aae3165981d166a297a |
|
BLAKE2b-256 | 150dff94960dc8cbadc9988f596b28a8a94f67df0ce92680dbd23d8ffb30756f |