runway.cfngin.stack module

CFNgin stack.

class runway.cfngin.stack.Stack(definition, context, variables=None, mappings=None, locked=False, force=False, enabled=True, protected=False)[source]

Bases: object

Represents gathered information about a stack to be built/updated.

definition

The stack definition from the config.

Type

runway.cfngin.config.Stack

enabled

Whether this stack is enabled

Type

bool

force

Whether to force updates on this stack.

Type

bool

fqn

Fully qualified name of the stack. Combines the stack name and current namespace.

Type

str

in_progress_behavior

The behavior for when a stack is in CREATE_IN_PROGRESS or UPDATE_IN_PROGRESS.

Type

Optional[str]

locked

Whether or not the stack is locked.

Type

bool

logging

Whether logging is enabled.

Type

bool

mappings

Cloudformation mappings passed to the blueprint.

Type

Optional[Dict[str, Dict[str, Any]]]

name

Name of the stack taken from the definition.

Type

str

outputs

CloudFormation Stack outputs

Type

Optional[Dict[str, Any]]

profile

Profile name from the stack definition.

Type

str

protected

Whether this stack is protected.

Type

bool

region

AWS region name.

Type

str

termination_protection

The state of termination protection to apply to the stack.

Type

bool

variables

Variables for the stack.

Type

Optional[Dict[str, Any]]

Instantiate class.

Parameters
  • definition (runway.cfngin.config.Stack) – A stack definition.

  • context (runway.cfngin.context.Context) – Current context for building the stack.

  • variables (Optional[Dict[str, Any]]) – Variables for the stack.

  • mappings (Optional[Dict[str, Dict[str, Any]]]) – Cloudformation mappings passed to the blueprint.

  • locked (bool) – Whether or not the stack is locked.

  • force (bool) – Whether to force updates on this stack.

  • enabled (bool) – Whether this stack is enabled

  • protected (bool) – Whether this stack is protected.

property required_by

Return a list of stack names that depend on this stack.

Returns

List[str]

property requires

Return a list of stack names this stack depends on.

Returns

List[str]

property stack_policy

Return the Stack Policy to use for this stack.

property blueprint

Return the blueprint associated with this stack.

property tags

Return the tags that should be set on this stack.

Includes both the global tags, as well as any stack specific tags or overrides.

Returns

Dictionary of tags.

Return type

Dict[str, str]

property parameter_values

Return all CloudFormation Parameters for the stack.

CloudFormation Parameters can be specified via Blueprint Variables with a runway.cfngin.blueprints.variables.types.CFNType type.

Returns

dictionary of <parameter name>: <parameter value>.

Return type

Dict[str, Any]

property all_parameter_definitions

Return a list of all parameters in the blueprint/template.

Dict[str, Dict[str, str]]: parameter definitions. Keys are parameter names, the values are dicts containing key/values for various parameter properties.

property required_parameter_definitions

Return all CloudFormation Parameters without a default value.

Returns

dict of required CloudFormation Parameters for the blueprint. Will be a dictionary of <parameter name>: <parameter attributes>.

Return type

Dict[str, Dict[str, str]]

resolve(context, provider)[source]

Resolve the Stack variables.

This resolves the Stack variables and then prepares the Blueprint for rendering by passing the resolved variables to the Blueprint.

Parameters
set_outputs(outputs)[source]

Set stack outputs to the provided value.

Parameters

outputs (Dict[str, Any]) – CloudFormation Stack outputs.