runway.lookups.handlers.var module

Retrieve a variable from the variables file or definition.

If the Lookup is unable to find an defined variable matching the provided query, the default value is returned or a ValueError is raised if a default value was not provided.

Nested values can be used by providing the full path to the value but, it will not select a list element.

The returned value can contain any YAML support data type (dictionaries/mappings/hashes, lists/arrays/sequences, strings, numbers, and booleon).


This Lookup supports all Common Lookup Arguments but, the folling have limited or no effect:

  • region


  - modules:
      - path: sampleapp.cfn
          ami_id: ${var ami_id.${env AWS_REGION}}
      SOME_VARIABLE: ${var some_variable::default=default}
class runway.lookups.handlers.var.VarLookup[source]

Bases: runway.lookups.handlers.base.LookupHandler

Variable definition Lookup.

classmethod handle(value, context, **kwargs)[source]

Retrieve a variable from the variable definition.

The value is retrieved from the variables passed to Runway using either a variables file or the variables directive of the config file.

  • value – The value passed to the Lookup.

  • variables – The resolved variables pass to Runway.


ValueError – Unable to find a value for the provided query and a default value was not provided.