runway.cfngin.stack module

CFNgin stack.

class runway.cfngin.stack.Stack[source]

Bases: object

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

definition

The stack definition from the config.

Type

CfnginStackDefinitionModel

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[Literal[‘wait’]]

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

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

name

Name of the stack taken from the definition.

Type

str

outputs

CloudFormation Stack outputs.

Type

Dict[str, Any]

protected

Whether this stack is protected.

Type

bool

termination_protection

The state of termination protection to apply to the stack.

Type

bool

variables

Variables for the stack.

Type

List[Variable]

__init__(definition: CfnginStackDefinitionModel, context: CfnginContext, *, variables: Optional[Dict[str, Any]] = None, mappings: Dict[str, Dict[str, Dict[str, Any]]] = None, locked: bool = False, force: bool = False, enabled: bool = True, protected: bool = False)[source]

Instantiate class.

Parameters
  • definition – A stack definition.

  • context – Current context for deploying the stack.

  • variables – Variables for the stack.

  • mappings – Cloudformation mappings passed to the blueprint.

  • locked – Whether or not the stack is locked.

  • force – Whether to force updates on this stack.

  • enabled – Whether this stack is enabled

  • protected – Whether this stack is protected.

__new__(**kwargs)
property required_by: Set[str]

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

property requires: Set[str]

Return a list of stack names this stack depends on.

property stack_policy: Optional[str]

Return the Stack Policy to use for this stack.

property blueprint: Blueprint

Return the blueprint associated with this stack.

property tags: Dict[str, Any]

Return the tags that should be set on this stack.

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

property parameter_values: Dict[str, Any]

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>.

property all_parameter_definitions: Dict[str, Any]

Return all parameters in the blueprint/template.

property required_parameter_definitions: Dict[str, Any]

Return all CloudFormation Parameters without a default value.

resolve(context: CfnginContext, provider: Optional[Provider] = None) None[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
  • context – CFNgin context.

  • provider – Subclass of the base provider.

set_outputs(outputs: Dict[str, Any]) None[source]

Set stack outputs to the provided value.

Parameters

outputs – CloudFormation Stack outputs.

__repr__() str[source]

Object represented as a string.