stacker.commands.stacker package

Submodules

stacker.commands.stacker.base module

class stacker.commands.stacker.base.BaseCommand(setup_logging=None, *args, **kwargs)[source]

Bases: future.types.newobject.newobject

Base class for all stacker subcommands.

The way argparse handles common arguments that should be passed to the subparser is confusing. You can add arguments to the parent parser that will get passed to the subparser, but these then need to be provided on the command line before specifying the subparser. Furthermore, when viewing the help for a subcommand, you can’t view these parameters.

By including shared parameters for stacker commands within this subclass, we don’t have to redundantly add the parameters we want on all subclasses within each subparser and these shared parameters are treated as normal arguments to the subcommand.

add_arguments(parser)[source]
add_subcommands(parser)[source]
configure(options, **kwargs)[source]
description = None
get_context_kwargs(options, **kwargs)[source]

Return a dictionary of kwargs that will be used with the Context.

This allows commands to pass in any specific arguments they define to the context.

Parameters:options (argparse.Namespace) – arguments that have been passed via the command line
Returns:
Dictionary that will be passed to Context initializer as
kwargs.
Return type:dict
name = None
parse_args(*vargs)[source]
run(options, **kwargs)[source]
subcommands = ()
subcommands_help = None
class stacker.commands.stacker.base.KeyValueAction(option_strings, dest, default=None, nargs=None, **kwargs)[source]

Bases: argparse.Action

stacker.commands.stacker.base.cancel()[source]

Returns a threading.Event() that will get set when SIGTERM, or SIGINT are triggered. This can be used to cancel execution of threads.

stacker.commands.stacker.base.environment_file(input_file)[source]

Reads a stacker environment file and returns the resulting data.

stacker.commands.stacker.base.key_value_arg(string)[source]

stacker.commands.stacker.build module

Launches or updates CloudFormation stacks based on the given config.

Stacker is smart enough to figure out if anything (the template or parameters) have changed for a given stack. If nothing has changed, stacker will correctly skip executing anything against the stack.

class stacker.commands.stacker.build.Build(setup_logging=None, *args, **kwargs)[source]

Bases: stacker.commands.stacker.base.BaseCommand

add_arguments(parser)[source]
description = 'Launches or updates CloudFormation stacks based on the given config.\n\nStacker is smart enough to figure out if anything (the template or parameters)\nhave changed for a given stack. If nothing has changed, stacker will correctly\nskip executing anything against the stack.\n\n'
get_context_kwargs(options, **kwargs)[source]

Return a dictionary of kwargs that will be used with the Context.

This allows commands to pass in any specific arguments they define to the context.

Parameters:options (argparse.Namespace) – arguments that have been passed via the command line
Returns:
Dictionary that will be passed to Context initializer as
kwargs.
Return type:dict
name = 'build'
run(options, **kwargs)[source]

stacker.commands.stacker.destroy module

Destroys CloudFormation stacks based on the given config.

Stacker will determine the order in which stacks should be destroyed based on any manual requirements they specify or output values they rely on from other stacks.

class stacker.commands.stacker.destroy.Destroy(setup_logging=None, *args, **kwargs)[source]

Bases: stacker.commands.stacker.base.BaseCommand

add_arguments(parser)[source]
description = 'Destroys CloudFormation stacks based on the given config.\n\nStacker will determine the order in which stacks should be destroyed based on\nany manual requirements they specify or output values they rely on from other\nstacks.\n\n'
get_context_kwargs(options, **kwargs)[source]

Return a dictionary of kwargs that will be used with the Context.

This allows commands to pass in any specific arguments they define to the context.

Parameters:options (argparse.Namespace) – arguments that have been passed via the command line
Returns:
Dictionary that will be passed to Context initializer as
kwargs.
Return type:dict
name = 'destroy'
run(options, **kwargs)[source]

stacker.commands.stacker.diff module

Diffs the config against the currently running CloudFormation stacks

Sometimes small changes can have big impacts. Run “stacker diff” before “stacker build” to detect bad things(tm) from happening in advance!

class stacker.commands.stacker.diff.Diff(setup_logging=None, *args, **kwargs)[source]

Bases: stacker.commands.stacker.base.BaseCommand

add_arguments(parser)[source]
description = ' Diffs the config against the currently running CloudFormation stacks\n\nSometimes small changes can have big impacts. Run "stacker diff" before\n"stacker build" to detect bad things(tm) from happening in advance!\n'
get_context_kwargs(options, **kwargs)[source]

Return a dictionary of kwargs that will be used with the Context.

This allows commands to pass in any specific arguments they define to the context.

Parameters:options (argparse.Namespace) – arguments that have been passed via the command line
Returns:
Dictionary that will be passed to Context initializer as
kwargs.
Return type:dict
name = 'diff'
run(options, **kwargs)[source]

stacker.commands.stacker.info module

Gets information on the CloudFormation stacks based on the given config.

class stacker.commands.stacker.info.Info(setup_logging=None, *args, **kwargs)[source]

Bases: stacker.commands.stacker.base.BaseCommand

add_arguments(parser)[source]
description = 'Gets information on the CloudFormation stacks based on the given config.'
get_context_kwargs(options, **kwargs)[source]

Return a dictionary of kwargs that will be used with the Context.

This allows commands to pass in any specific arguments they define to the context.

Parameters:options (argparse.Namespace) – arguments that have been passed via the command line
Returns:
Dictionary that will be passed to Context initializer as
kwargs.
Return type:dict
name = 'info'
run(options, **kwargs)[source]

Module contents

class stacker.commands.stacker.Stacker(setup_logging=None, *args, **kwargs)[source]

Bases: stacker.commands.stacker.base.BaseCommand

add_arguments(parser)[source]
configure(options, **kwargs)[source]
name = 'stacker'
subcommands = (<class 'stacker.commands.stacker.build.Build'>, <class 'stacker.commands.stacker.destroy.Destroy'>, <class 'stacker.commands.stacker.info.Info'>, <class 'stacker.commands.stacker.diff.Diff'>, <class 'stacker.commands.stacker.graph.Graph'>)