runway.config package¶
CFNgin config.
-
class
runway.config.
BaseConfig
(data: BaseModel, *, path: Optional[Path] = None)[source]¶ Bases:
object
Base class for configurations.
Instantiate class.
- Parameters
data – The data model of the config file.
path – Path to the config file.
-
dump
(*, by_alias: bool = False, exclude: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any]]] = None, exclude_defaults: bool = False, exclude_none: bool = False, exclude_unset: bool = True, include: Optional[Union[AbstractSet[Union[int, str]], Mapping[Union[int, str], Any]]] = None) → str[source]¶ Dump model to a YAML string.
- Parameters
by_alias – Whether field aliases should be used as keys in the returned dictionary.
exclude – Fields to exclude from the returned dictionary.
exclude_defaults – Whether fields which are equal to their default values (whether set or otherwise) should be excluded from the returned dictionary.
exclude_none – Whether fields which are equal to None should be excluded from the returned dictionary.
exclude_unset – Whether fields which were not explicitly set when creating the model should be excluded from the returned dictionary.
include – Fields to include in the returned dictionary.
-
file_path
: Path¶
-
classmethod
find_config_file
(path: pathlib.Path) → Optional[pathlib.Path][source]¶ Find a config file in the provided path.
- Parameters
path – The path to search for a config file.
-
class
runway.config.
CfnginConfig
(data: runway.config.models.cfngin.CfnginConfigDefinitionModel, *, path: Optional[pathlib.Path] = None)[source]¶ Bases:
runway.config.BaseConfig
Python representation of a CFNgin config file.
This is used internally by CFNgin to parse and validate a YAML formatted CFNgin configuration file, but can also be used in scripts to generate a CFNgin config file before handing it off to CFNgin to deploy/destroy.
Example:
from runway.cfngin.config import dump, Config, Stack vpc = Stack({ "name": "vpc", "class_path": "blueprints.VPC"}) config = Config() config.namespace = "prod" config.stacks = [vpc] print dump(config)
Instantiate class.
- Parameters
data – The data model of the config file.
path – Path to the config file.
-
EXCLUDE_LIST
= ['bitbucket-pipelines.yml', 'buildspec.yml', 'docker-compose.yml']¶
-
EXCLUDE_REGEX
= 'runway(\\..*)?\\.(yml|yaml)'¶
-
cfngin_bucket
: Optional[str]¶ Bucket to use for CFNgin resources. (e.g. CloudFormation templates). May be an empty string.
-
cfngin_bucket_region
: Optional[str]¶ Explicit region to use for
CfnginConfig.cfngin_bucket
-
cfngin_cache_dir
: Path¶ Local directory to use for caching.
-
classmethod
find_config_file
(path: Optional[pathlib.Path] = None, *, exclude: Optional[List[str]] = None) → List[pathlib.Path][source]¶ Find a config file in the provided path.
- Parameters
path – The path to search for a config file.
exclude – List of file names to exclude. This list is appended to the global exclude list.
- Raises
ConfigNotFound – Could not find a config file in the provided path.
ValueError – More than one config file found in the provided path.
-
package_sources
: CfnginPackageSourcesDefinitionModel¶ Remote source locations.
-
classmethod
parse_file
(*, path: Optional[pathlib.Path] = None, file_path: Optional[pathlib.Path] = None, parameters: Optional[MutableMapping[str, Any]] = None, **kwargs: Any) → runway.config.CfnginConfig[source]¶ Parse a YAML file to create a config object.
- Parameters
path – The path to search for a config file.
file_path – Exact path to a file to parse.
parameters – Values to use when resolving a raw config.
- Raises
ConfigNotFound – Provided config file was not found.
-
classmethod
parse_obj
(obj: Any, *, path: Optional[pathlib.Path] = None) → runway.config.CfnginConfig[source]¶ Parse a python object.
- Parameters
obj – A python object to parse as a CFNgin config.
path – The path to the config file that was parsed into the object.
-
classmethod
parse_raw
(data: str, *, parameters: Optional[MutableMapping[str, Any]] = None, path: Optional[pathlib.Path] = None, skip_package_sources: bool = False) → runway.config.CfnginConfig[source]¶ Parse raw data.
- Parameters
data – The raw data to parse.
parameters – Values to use when resolving a raw config.
path – The path to search for a config file.
skip_package_sources – Skip processing package sources.
-
post_deploy
: List[CfnginHookDefinitionModel]¶ Hooks to run after a deploy action.
-
post_destroy
: List[CfnginHookDefinitionModel]¶ Hooks to run after a destroy action.
-
pre_deploy
: List[CfnginHookDefinitionModel]¶ Hooks to run before a deploy action.
-
pre_destroy
: List[CfnginHookDefinitionModel]¶ Hooks to run before a destroy action.
-
classmethod
process_package_sources
(raw_data: str, *, parameters: Optional[MutableMapping[str, Any]] = None) → str[source]¶ Process the package sources defined in a rendered config.
- Parameters
raw_data – Raw configuration data.
parameters – Values to use when resolving a raw config.
-
static
render_raw_data
(raw_data: str, *, parameters: Optional[MutableMapping[str, Any]] = None) → str[source]¶ Render raw data.
- Parameters
raw_data – Raw configuration data.
parameters – Values to use when resolving a raw config.
- Raises
MissingEnvironment – A value required by the config was not provided in parameters.
-
stacks
: List[CfnginStackDefinitionModel]¶ Stacks to be processed.
-
sys_path
: Optional[Path]¶ Relative or absolute path to use as the work directory.
Tags to apply to all resources.
-
class
runway.config.
RunwayConfig
(data: runway.config.models.runway.RunwayConfigDefinitionModel, *, path: Optional[pathlib.Path] = None)[source]¶ Bases:
runway.config.BaseConfig
Python representation of a Runway config file.
Instantiate class.
- Parameters
data – The data model of the config file.
path – Path to the config file.
-
ACCEPTED_NAMES
= ['runway.yml', 'runway.yaml']¶
-
deployments
: List[RunwayDeploymentDefinition]¶
-
file_path
: Path¶
-
classmethod
find_config_file
(path: pathlib.Path) → pathlib.Path[source]¶ Find a config file in the provided path.
- Parameters
path – The path to search for a config file.
- Raises
ConfigNotFound – Could not find a config file in the provided path.
ValueError – More than one config file found in the provided path.
-
future
: RunwayFutureDefinitionModel¶
-
classmethod
parse_file
(*, path: Optional[pathlib.Path] = None, file_path: Optional[pathlib.Path] = None, **kwargs: Any) → runway.config.RunwayConfig[source]¶ Parse a YAML file to create a config object.
- Parameters
path – The path to search for a config file.
file_path – Exact path to a file to parse.
- Raises
ConfigNotFound – Provided config file was not found.
ValueError – path and file_path were both excluded.
-
classmethod
parse_obj
(obj: Any, *, path: Optional[pathlib.Path] = None) → runway.config.RunwayConfig[source]¶ Parse a python object into a config object.
- Parameters
obj – The object to be parsed.
path – Path to the file the object was parsed from.
-
runway_version
: Optional[SpecifierSet]¶
-
tests
: List[RunwayTestDefinition]¶
-
variables
: RunwayVariablesDefinition¶