Skip to content

Commit

Permalink
Merge pull request #67 from remind101/gh-55
Browse files Browse the repository at this point in the history
Update README for new subcommand system
  • Loading branch information
phobologic committed Aug 12, 2015
2 parents e4957b5 + 23aa44b commit c583962
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 41 deletions.
52 changes: 11 additions & 41 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ At this point this is very much alpha software - it is still in heavy
development, and interfaces/configuration/etc may/will likely/most definitely
change :)

Stacker Command
===============

The stacker command is built to have sub-commands, much like git. Currently the
only implemented command is ``build``, which handles taking your stack config
and then launching or updating stacks as necessary.

Example
=======

We've provided an example stack in *conf/example.yaml* that can be launched
in your account. It creates 4 stacks:

- A VPC (including NAT hosts in each AZ)
- A VPC (including NAT hosts in each AZ, and dns entries in *BaseDomain*)
- A public, route53 zone (*BaseDomain* parameter)
- A bastion stack (for ssh'ing into other stacks on the VPC)
- A RDS stack (postgres)
- An autoscaling group stack
Expand All @@ -33,45 +41,7 @@ if you'd like to play with something smaller. To launch the stacks, after
installing stacker and loading your AWS API keys in your environment
(AWS\_ACCESS\_KEY\_ID & AWS\_SECRET\_ACCESS\_KEY), call the following::

stacker -v -p BaseDomain=example.com -r us-east-1 -p AZCount=2 -p CidrBlock=10.128.0.0/16 example.com conf/example.yaml

Here's the syntax help from the command::

# stacker -h
usage: stacker [-h] [-r REGION] [-m MAX_ZONES] [-v] [-p PARAMETER=VALUE]
[--stacks STACKNAME]
namespace config

Launches or updates cloudformation stacks based on the given config. The
script is smart enough to figure out if anything (the template, or parameters)
has changed for a given stack. If not, it will skip that stack. Can also pull
parameters from other stack's outputs.

positional arguments:
namespace The namespace for the stack collection. This will be
used as the prefix to the cloudformation stacks as
well as the s3 bucket where templates are stored.
config The config file where stack configuration is located.
Must be in yaml format.

optional arguments:
-h, --help show this help message and exit
-r REGION, --region REGION
The AWS region to launch in. Default: us-east-1
-m MAX_ZONES, --max-zones MAX_ZONES
Gives you the ability to limit the # of zones that
resources will be launched in. If not given, then
resources will be launched in all available
availability zones.
-v, --verbose Increase output verbosity. May be specified up to
twice.
-p PARAMETER=VALUE, --parameter PARAMETER=VALUE
Adds parameters from the command line that can be used
inside any of the stacks being built. Can be specified
more than once.
--stacks STACKNAME Only work on the stacks given. Can be specified more
than once. If not specified then stacker will work on
all stacks in the config file.
stacker build -v -p BaseDomain=blahblah.com -r us-east-1 example.com conf/example.yaml

As of now there is no option to tear down the stack in the tool (we plan to
add it), so you'll need to tear the stacks it creates down manually. When doing
Expand All @@ -92,7 +62,7 @@ different ways:
- from an existing stack

Each of those overrides similarly named parameters beneath it, so if you
use ``-p CidrBlock`` on the command line, it doesn't matter what is in the
use ``-p CidrBlock=`` on the command line, it doesn't matter what is in the
config file or any existing stacks. This is useful if, for example, you want
to keep sensitive information (passwords, etc) out of the config file (which
you'll likely check into a RCS), but need a way to supply them.
Expand Down
1 change: 1 addition & 0 deletions conf/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ stacks:
# Enough subnets for 4 AZs
PublicSubnets: 10.128.0.0/24,10.128.1.0/24,10.128.2.0/24,10.128.3.0/24
PrivateSubnets: 10.128.8.0/22,10.128.12.0/22,10.128.16.0/22,10.128.20.0/22
CidrBlock: 10.128.0.0/16
# Uncomment if you want an internal hosted zone for the VPC
# If provided, it will be added to the dns search path of the DHCP
# Options
Expand Down

0 comments on commit c583962

Please sign in to comment.