runway.cfngin.cfngin module

CFNgin entrypoint.

class runway.cfngin.cfngin.CFNgin(ctx, parameters=None, sys_path=None)[source]

Bases: object

Control CFNgin.

EXCLUDE_REGEX

Regex used to exclude YAML files when searching for config files.

Type

str

EXCLUDE_LIST

Global list of YAML file names to exclude when searching for config files.

Type

str

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

Wether or not to prompt the user before taking action.

Type

bool

parameters

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

Type

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

str

tail

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

Type

bool

Instantiate class.

Parameters
  • ctx (runway.context.Context) – Runway context object.

  • parameters (Optional[Dict[str. Any]]) – Parameters from Runway.

  • sys_path (Optional[str]) – Working directory.

EXCLUDE_REGEX = 'runway(\\..*)?\\.(yml|yaml)'
EXCLUDE_LIST = ['bitbucket-pipelines.yml', 'buildspec.yml', 'docker-compose.yml']
env_file

Decorator for creating cached properties.

A property that is only computed once per instance and then replaces itself with an ordinary attribute. Deleting the attribute resets the property. Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76

deploy(force=False, sys_path=None)[source]

Run the CFNgin deploy action.

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

  • sys_path (Optional[str]) – Explicitly define a path to work in. If not provided, self.sys_path is used.

destroy(force=False, sys_path=None)[source]

Run the CFNgin destroy action.

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

  • sys_path (Optional[str]) – Explicitly define a path to work in. If not provided, self.sys_path is used.

load(config_path)[source]

Load a CFNgin config into a context object.

Parameters

config_path (str) – Valid path to a CFNgin config file.

Returns

runway.cfngin.context.Context

plan(force=False, sys_path=None)[source]

Run the CFNgin plan action.

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

  • sys_path (Optional[str]) – Explicitly define a path to work in. If not provided, self.sys_path is used.

should_skip(force=False)[source]

Determine if action should be taken or not.

Parameters

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

Returns

Skip action or not.

Return type

bool

classmethod find_config_files(exclude=None, sys_path=None)[source]

Find CFNgin config files.

Parameters
  • exclude (Optional[List[str]]) – List of file names to exclude. This list is appended to the global exclude list.

  • sys_path (Optional[str]) – Explicitly define a path to search for config files.

Returns

Path to config files that were found.

Return type

List[str]