runway.cfngin.stack module

CFNgin stack.

class runway.cfngin.stack.Stack(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]

Bases: object

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

definition

The stack definition from the config.

enabled

Whether this stack is enabled

force

Whether to force updates on this stack.

fqn

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

in_progress_behavior

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

locked

Whether or not the stack is locked.

logging

Whether logging is enabled.

mappings

Cloudformation mappings passed to the blueprint.

name

Name of the stack taken from the definition.

outputs

CloudFormation Stack outputs.

protected

Whether this stack is protected.

termination_protection

The state of termination protection to apply to the stack.

variables

Variables for the stack.

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.

name: str
context: CfnginContext
definition: CfnginStackDefinitionModel
enabled: bool
force: bool
fqn: str
in_progress_behavior: Optional[Literal[‘wait’]]
locked: bool
logging: bool
mappings: Dict[str, Dict[str, Dict[str, Any]]]
outputs: Dict[str, Any]
protected: bool
termination_protection: bool
variables: List[Variable]
property required_by

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

property requires

Return a list of stack names this stack depends on.

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.

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

property all_parameter_definitions

Return all parameters in the blueprint/template.

property required_parameter_definitions

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.