Conditional source

The conditional source selects an active source based on a key typically controlled by an environment variable. It is typically used in devops to be able to use the same configuration in different type of environments (i.e. development, staging, production). The actual source to use is resolved at runtime when the parent pipe is created.

The configuration options are:

Prototype

{
   "type": "conditional",
   "condition": "$ENV(current-environment)",
   "alternatives": {
       "dev": {
           "type": "embedded",
           ..
       },
       "test": {
           "type": "sql",
           ..
       },
       "prod": {
           "type": "sql",
           ..
       }
   }
}

Properties

Property

Type

Description

Default

Req

condition

String

The key to look up in alternatives for the actual source to use at runtime. Typically an environment variable. Note that all possible enumerations of this value need to exist in alternatives.

Yes

alternatives

Object

A dictionary of actual source configurations keyed by the enumerated value of condition.

Yes