runway.core.components package

Core Runway components.

class runway.core.components.DeployEnvironment(_=None, **kwargs)[source]

Bases: object

Runway deploy environment.

Instantiate class.

Keyword Arguments
  • environ (Optional[Dict[str, str]]) – Environment variables.

  • explicit_name (Optional[str]) – Explicitly provide the deploy environment name.

  • ignore_git_branch (bool) – Ignore the git branch when determining the deploy environment name.

  • root_dir (Optional[Path]) – Root directory of the project.

property aws_credentials

Get AWS credentials from environment variables.

property aws_profile

Get AWS profile from environment variables.

property aws_region

Get AWS region from environment variables.

branch_name

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

property ci

Return CI status.

Returns

bool

copy()[source]

Copy the contents of this object into a new instance.

Returns

New instance with the same contents.

Return type

DeployEnvironment

property debug

Get debug setting from the environment.

property ignore_git_branch

Whether to ignore git branch when determining name.

log_name()[source]

Output name to log.

property max_concurrent_cfngin_stacks

Max number of CFNgin stacks that can be deployed concurrently.

This property can be set by exporting RUNWAY_MAX_CONCURRENT_CFNGIN_STACKS. If no value is specified, the value will be constrained based on the underlying graph.

Returns

Value from environment variable or 0.

Return type

int

property max_concurrent_modules

Max number of modules that can be deployed to concurrently.

This property can be set by exporting RUNWAY_MAX_CONCURRENT_MODULES. If no value is specified, min(61, os.cpu_count()) is used.

On Windows, this must be equal to or lower than 61.

IMPORTANT: When using parallel_regions and child_modules together, please consider the nature of their relationship when manually setting this value. (parallel_regions * child_modules)

Returns

Value from environment variable or min(61, os.cpu_count())

Return type

int

property max_concurrent_regions

Max number of regions that can be deployed to concurrently.

This property can be set by exporting RUNWAY_MAX_CONCURRENT_REGIONS. If no value is specified, min(61, os.cpu_count()) is used.

On Windows, this must be equal to or lower than 61.

IMPORTANT: When using parallel_regions and child_modules together, please consider the nature of their relationship when manually setting this value. (parallel_regions * child_modules)

Returns

Value from environment variable or min(61, os.cpu_count())

Return type

int

name

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

property verbose

Get verbose setting from the environment.

class runway.core.components.Deployment(context, definition, future=None, variables=None)[source]

Bases: object

Runway deployment.

Instantiate class.

Parameters
property account_alias_config

Parse the definition to get the correct AWS account alias configuration.

Returns

Expected AWS account alias for the current context.

Return type

Optional[str]

property account_id_config

Parse the definition to get the correct AWS account ID configuration.

Returns

Expected AWS account ID for the current context.

Return type

Optional[str]

property assume_role_config

Parse the definition to get the correct assume role configuration.

Returns

Assume role definition for the current context.

Return type

Dict[str, Union[int, str]]

deploy()[source]

Deploy the deployment.

High level method for running a deployment.

destroy()[source]

Destroy the deployment.

High level method for running a deployment.

property env_vars_config

Parse the definition to get the correct env_vars configuration.

plan()[source]

Plan for the next deploy of the deployment.

High level method for running a deployment.

regions

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

run(action, region)[source]

Run a single deployment in a single region.

Low level API access to run a deployment object.

Parameters
  • action (str) – Action to run (deploy, destroy, plan, etc.)

  • region (str) – AWS region to run in.

classmethod run_list(action, context, deployments, future, variables)[source]

Run a list of deployments.

Parameters
use_async

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

validate_account_credentials(context=None)[source]

Exit if requested deployment account doesn’t match credentials.

Parameters

context (Optional[Context]) – Context object.

Raises

SystemExit – AWS Account associated with the current credentials did not match the defined criteria.

class runway.core.components.Module(context, definition, deployment=None, future=None, variables=None)[source]

Bases: object

Runway module.

Instantiate class.

Parameters
child_modules

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()[source]

Deploy the module.

High level method for running a module.

destroy()[source]

Destroy the module.

High level method for running a module.

fqn

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

path

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

payload

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

plan()[source]

Plan for the next deploy of the module.

High level method for running a module.

run(action)[source]

Run a single module.

Low level API access to run a module object.

Parameters

action – Name of action to run.

classmethod run_list(action, context, modules, variables, deployment=None, future=None)[source]

Run a list of modules.

Parameters
  • action – Name of action to run.

  • context – Runway context.

  • modules – List of modules to run.

  • variables – Variable definition for resolving lookups in the module.

  • deployment – Deployment the modules are a part of.

  • future (Optional[FutureDefinition]) – Future functionality configuration.

should_skip

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

type

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

use_async

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