Skip to main content

Start and stop EC2s using tags. now in color!

Project description


start and stop ec2 instances.


install with pip

pip install trafficlight


-aws cli (installed and configured)


  -h, --help     show this help message and exit  
  --key KEY      optional. use a tag key besides Name  
  -R REGION, --region REGION
                 specify a different region
  -g, --green    start.  
  -r, --red      stop.  
  -L, --leave    do not change instance state.
  -y, --yes      automatically approve instance state change.  
  -H, --host     use hostnames instead of ip addresses.  
  -c, --connect  begin an ssh session.  
  -K, --keyfile  write pem keyfile to trafficlight config.  
  -p, --pipe     output instance ip or hostname via standard out to pipe into other commands.  
  -v, --version  show program's version number and exit  


show trafficlight help page, including usage and flags.
$ trafficlight -h

switch instance with tag Name:example. if instance is stopped it will start, if it's running it will stop.
$ trafficlight example

connect to ec2 instance with tag Name:example. if instance is stopped it will start the instance first.
$ trafficlight example -c

specify a different region.
$ trafficlight example -R us-west-1

update trafficlight's config file with keyfile for using -c --connect flag.
$ trafficlight -K

start all instances with tag Name:example. if instances are started already they will stay up.
$ trafficlight example -g

stop all instances tag Name:example. if instances are stopped already they will stay stopped.
$ trafficlight example -r

get instance info for tag, but don't change instance state.
$ trafficlight example -L

stop all instances with tag Products:example.
$ trafficlight example --key Products -r

list all ec2s and do nothing.
$ trafficlight

list all ec2s and stop them.
$ trafficlight -r

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for trafficlight, version 1.4.7
Filename, size File type Python version Upload date Hashes
Filename, size trafficlight-1.4.7.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View
Filename, size trafficlight-1.4.7-py3-none-any.whl (8.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page