runway.path module

Runway configuration ‘path’ settings.

class runway.path.Path(module, env_root, cache_dir=None, git_source_class=<class 'runway.sources.git.Git'>)[source]

Bases: object

Runway configuration path settings object.

Path is responsible for parsing the path property of a Runway configuration. It then can determine if the path specified is locally sourced or remotely sourced through a service such as `Git`_ or S3.

Local path variables are defined relative to the root project folder. The value for this cannot be higher than the Runway config file, it must be at the runway file itself or in a sub directory.

Example

deployments:
- modules:
    - path: my/local/module.cfn
    - my/local/module.cfn # same as above
    - ./ # module is in the root

When the path is remote, Runway is responsible for fetching the resource and returning the location of it’s cached path. The information for retrieving those sources can be controlled via runway rather than manually retrieving each one.

Example

deployments:
- modules:
    - path: git::git://github.com/your_handle/your_repo.git//my-module.cfn

The path structure is based on the encoding found in Terraform modules.

The values parsed from the string are as follows:

source

Determine if the source is local or remote. The initial prefix is used to determine this separated by :: in the string. A path is considered local if it contains no source type value.

Example

deployments:
    - modules:
        # source is `git`
        - path: git::git://github.com/foo/bar.git

uri

The uniform resource identifier when targetting a remote resource. This instructs runway on where to retrieve your module.

Example

deployments:
    - modules:
        # uri is `git://github.com/foo/bar.git`
        - path: git::git://github.com/foo/bar.git

location

The relative location of the module files from the root directory. This value is specified as a path after the uri separated by //

Example

deployments:
    - modules:
        # location is `my/path`
        - path: git::git://github.com/foo/bar.git//my/path

options

The remaining options that are passed along to the Source. This is specified in the path following the ? separator. Multiple option keys and values can be specified with the & as the separator. Each remote source can have different options for retrieval, please make sure to review individual source types to get more information on properly formatting.

Example

deployments:
    - modules:
        # options are `foo=bar&ba=bop`
        - path: git::git://github.com/foo/bar.git//my/path?foo=bar&baz=bop

Path Configuration.

Keyword Arguments
  • module (Union(str, Dict[str, str])) – The module manifest or a string representation of a local path to a module.

  • env_root (str) – The current environments root directory path string.

  • cache_dir (Optional[str]) – When a remote resource is requested it’s Source object requires a cache directory to store it’s request. This allows for an override of that default directory.

  • git_source_class (Optional[Git]) – Dependency injection for the Git type Source.

References

`Git`_

property configuration

Transform object into configuration settings for remote Sources.

classmethod parse(module)[source]

Retrieve the relevant elements of the path variable passed.

Given a dictionary with a path parameter parse the value into it’s specific components. The path structure is based on the encoding found in Terraform modules.

Parameters

module (Dict[str, str]) – The module manifest or a string representation of a local path to a module.