runway.cfngin.cfngin module

CFNgin entrypoint.

class runway.cfngin.cfngin.CFNgin[source]

Bases: object

Control CFNgin.

concurrency

Max number of CFNgin stacks that can be deployed concurrently. If the value is 0, will be constrained based on the underlying graph.

Type

int

interactive

Whether or not to prompt the user before taking action.

Type

bool

parameters

Combination of the parameters provided when initializing the class and any environment files that are found.

Type

runway.utils.MutableMap

recreate_failed

Destroy and re-create stacks that are stuck in a failed state from an initial deployment when updating.

Type

bool

region

The AWS region where CFNgin is currently being executed.

Type

str

sys_path

Working directory.

Type

pathlib.Path

tail

Whether or not to display all CloudFormation events in the terminal.

Type

bool

__init__(ctx: runway.context.RunwayContext, parameters: Optional[Dict[str, Any]] = None, sys_path: Optional[pathlib.Path] = None) None[source]

Instantiate class.

Parameters
  • ctx – Runway context object.

  • parameters – Parameters from Runway.

  • sys_path – Working directory.

property env_file: runway.utils.MutableMap

Contents of a CFNgin environment file.

deploy(force: bool = False, sys_path: Optional[pathlib.Path] = None) None[source]

Run the CFNgin deploy action.

Parameters
  • force – Explicitly enable the action even if an environment file is not found.

  • sys_path – Explicitly define a path to work in. If not provided, self.sys_path is used.

destroy(force: bool = False, sys_path: Optional[pathlib.Path] = None) None[source]

Run the CFNgin destroy action.

Parameters
  • force – Explicitly enable the action even if an environment file is not found.

  • sys_path – Explicitly define a path to work in. If not provided, self.sys_path is used.

init(force: bool = False, sys_path: Optional[pathlib.Path] = None) None[source]

Initialize environment.

load(config_path: pathlib.Path) runway.context.CfnginContext[source]

Load a CFNgin config into a context object.

Parameters

config_path – Valid path to a CFNgin config file.

__new__(**kwargs)
plan(force: bool = False, sys_path: Optional[pathlib.Path] = None)[source]

Run the CFNgin plan action.

Parameters
  • force – Explicitly enable the action even if an environment file is not found.

  • sys_path – Explicitly define a path to work in. If not provided, self.sys_path is used.

should_skip(force: bool = False) bool[source]

Determine if action should be taken or not.

Parameters

force – If True, will always return False meaning the action should not be skipped.

classmethod find_config_files(exclude: Optional[List[str]] = None, sys_path: Optional[pathlib.Path] = None) List[pathlib.Path][source]

Find CFNgin config files.

Parameters
  • exclude – List of file names to exclude. This list is appended to the global exclude list.

  • sys_path – Explicitly define a path to search for config files.

Returns

Paths to config files that were found.