runway.context module

Runway context module.

class runway.context.Context(_=None, **kwargs)[source]

Bases: object

Runway execution context.

Instantiate class.

Keywork Arguments:

command (Optional[str]): Runway command/action being run. deploy_environment (Optional[DeployEnvironment]): Current

deploy environment.

property boto3_credentials

Return a dict of boto3 credentials.

property current_aws_creds

AWS credentials from self.env_vars.

Returns

Dict[str, str]

env_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 env_region

Get or set the current AWS region [DEPRECATED].

property env_root

Get environment root directory [DEPRECATED].

property env_vars

Get environment variables [DEPRECATED].

no_color

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 is_interactive

Wether the user should be prompted or not.

Determined by the existed of CI in the environment.

Returns

bool

property is_noninteractive

Wether the user should be prompted or not.

Determined by the existed of CI in the environment. Inverse of is_interactive property.

Returns

bool

property is_python3

Wether running in Python 3 or not.

Used for Python compatability decisions.

Returns

bool

property use_concurrent

Wether to use concurrent.futures or not.

Noninteractive is required for concurrent execution to prevent weird user-input behavior.

Python 3 is required because backported futures has issues with ProcessPoolExecutor.

Returns

bool

copy()[source]

Copy the contents of this object into a new instance.

Returns

New instance with the same contents.

Return type

Context

echo_detected_environment()[source]

Print a helper note about how the environment was determined.

get_session(profile=None, region=None)[source]

Create a thread-safe boto3 session.

Parameters
  • profile (Optional[str]) – The profile for the session.

  • region (Optional[str]) – The region for the session.

Returns

A thread-safe boto3 session.

Return type

boto3.session.Session