npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

opsworks-cli

v0.1.1

Published

Perform common OpsWorks tasks from the command line

Downloads

5

Readme

OpsWorks CLI

The Command Line Interface you wish Amazon shipped for OpsWorks.

Installation

npm install -g opsworks-cli

Usage

Before using this tool, it is important to know that unique naming conventions are expected throughout our OpsWorks configuration. Having stacks with the same name or layers of the same name will confuse this tool as it works on the human-readable labels assigned rather than the UUID's assigned by AWS internally.

Describe stack layers

This will list the layers in a stack

opsworks describe [stack]

List layer instances

This will list the instances in a layer

opsworks list [stack] [layer]

Add some instances

You can use opsworks-cli to quickly add instances to a layer. The basic syntax is:

opsworks add [stack] [layer]

Add instances across all Availability Zone's

The opsworks add command provides a flexible way to create new instances.

opsworks add my_stack my_layer --count 6 --size c3.large --prefix hostname_prefix --distribute --start

This command will create and start (via the --start flag) 6 new instances across the layer's Availability Zone's (via the --distribute flag). Instance hostnames are the concatenation of the prefix argument and the number of the created instance.

For example, running the above in us-east will result in the following instances being spawned:

hostname_prefix-0	c3.large	us-east-1a
hostname_prefix-1	c3.large	us-east-1b
hostname_prefix-2	c3.large	us-east-1d
hostname_prefix-3	c3.large	us-east-1a
hostname_prefix-4	c3.large	us-east-1b
hostname_prefix-5	c3.large	us-east-1d

SSH

opsworks ssh provides the ability to SSH into one or more instances. This works by starting a [tmux](http://en.wikipedia.org/wiki/Tmux) session, which must be available on your system.

Most Linux distributions have tmux available in their default repositories; there is a Homebrew formula available for OS X as well:

Ubuntu/Debian	apt-get install tmux
OS X			brew install tmux

Connect to a single instance

opsworks ssh my_stack my_layer -h my_instance_hostname

Connecting to an entire layer

This will create a multi-pane tmux session.

opsworks ssh my_stack my_layer

Configuring private key authentication

config.json, located in the install path of this module contains a default SSH key location. You may choose to change this:

opsworks config ssh.identity ~/.ssh/my_favorite_key

or supply a key manually (this will override the default key specified in config.json):

opsworks ssh my_stack my_layer -i ~/.ssh/my_other_key

Stopping instances

opsworks stop provides a way to stop instances. Stopped instances are not automatically deleted, see opsworks delete if you seek that functionality. There are two methods of stopping instances. You can stop all instances in a layer, or instances target by a prefix filter.

Stopping all instances in a layer

opsworks stop my_stack my_layer --all

Stopping instances matching a prefix

In the case where you may be looking to shut down all instances running some old software, being able to target them by a git ref or similar identifier makes this extremely easy.

opsworks stop my_stack my_layer --prefix git_6e84r37

Deleting instances

Only stopped instances can be deleted. Similar to stopping, you can delete instances matching a prefix or all instances in a layer.

Deleting all stopped instances in a layer

opsworks delete my_stack my_layer --all-stopped

Deleting instances matching a prefix

opsworks delete my_stack my_layer --prefix git_6e84r37

License

MIT