runway.cfngin.actions.build module

CFNgin build action.

runway.cfngin.actions.build.build_stack_tags(stack)[source]

Build a common set of tags to attach to a stack.

runway.cfngin.actions.build.should_update(stack)[source]

Test whether a stack should be submitted for updates to CloudFormation.

Parameters

stack (runway.cfngin.stack.Stack) – The stack object to check.

Returns

If the stack should be updated, return True.

Return type

bool

runway.cfngin.actions.build.should_submit(stack)[source]

Test whether a stack should be submitted to CF for update/create.

Parameters

stack (runway.cfngin.stack.Stack) – The stack object to check.

Returns

If the stack should be submitted, return True.

Return type

bool

runway.cfngin.actions.build.should_ensure_cfn_bucket(outline, dump)[source]

Test whether access to the cloudformation template bucket is required.

Parameters
  • outline (bool) – The outline action.

  • dump (bool) – The dump action.

Returns

If access to CF bucket is needed, return True.

Return type

bool

class runway.cfngin.actions.build.UsePreviousParameterValue[source]

Bases: object

Class used to indicate a Parameter should use it’s existing value.

runway.cfngin.actions.build.handle_hooks(stage, hooks, provider, context, dump, outline)[source]

Handle pre/post hooks.

Parameters
  • stage (str) – The name of the hook stage - pre_build/post_build.

  • hooks (list) – A list of dictionaries containing the hooks to execute.

  • provider (runway.cfngin.providers.base.BaseProvider) – The provider the current stack is using.

  • context (runway.cfngin.context.Context) – The current CFNgin context.

  • dump (bool) – Whether running with dump set or not.

  • outline (bool) – Whether running with outline set or not.

class runway.cfngin.actions.build.Action(context, provider_builder=None, cancel=None)[source]

Bases: runway.cfngin.actions.base.BaseAction

Responsible for building & coordinating CloudFormation stacks.

Generates the build plan based on stack dependencies (these dependencies are determined automatically based on output lookups from other stacks).

The plan can then either be printed out as an outline or executed. If executed, each stack will get launched in order which entails:

Instantiate class.

Parameters
  • context (runway.cfngin.context.Context) – The context for the current run.

  • provider_builder (Optional[BaseProviderBuilder]) – An object that will build a provider that will be interacted with in order to perform the necessary actions.

  • cancel (threading.Event) – Cancel handler.

DESCRIPTION = 'Create/Update stacks'
NAME = 'build'
static build_parameters(stack, provider_stack=None)[source]

Build the CloudFormation Parameters for our stack.

Parameters
Returns

The parameters for the given stack

Return type

Dict[str, Any]

pre_run(**kwargs)[source]

Any steps that need to be taken prior to running the action.

run(**kwargs)[source]

Kicks off the build/update of the stacks in the stack_definitions.

This is the main entry point for the Builder.

post_run(**kwargs)[source]

Any steps that need to be taken after running the action.