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:

Literal[‘wait’] | None

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: dict[str, Any] | None = None, mappings: dict[str, dict[str, dict[str, Any]]] | None = None, locked: bool = False, force: bool = False, enabled: bool = True, protected: bool = False) None[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.

__repr__() str[source]

Object represented as a string.

property all_parameter_definitions: dict[str, Any]

Return all parameters in the blueprint/template.

property blueprint: Blueprint

Return the blueprint associated with this stack.

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 required_by: set[str]

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

property required_parameter_definitions: dict[str, Any]

Return all CloudFormation Parameters without a default value.

property requires: set[str]

Return a list of stack names this stack depends on.

resolve(context: CfnginContext, provider: Provider | None = 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.

property stack_policy: str | None

Return the Stack Policy to use for 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.