Setting the Consul Connection Parameters
You set the values for app properties that you want to override by creating a Key/Value pair for each property in Consul. You can create a standalone property or a hierarchy that groups multiple related properties.
After you have configured the app properties in Consul, you need to set the environment variable, FLOGO_APP_PROPS_CONSUL with the Consul connection parameters in order for your app to connect to the Consul. When you set the environment variable, it triggers the app to run, which connects to the Consul using the Consul connection parameters you provided and pulls the app property values from the key_prefix location you set by matching the app property name with the key_name. Hence, it is mandatory for the Key names to be identical to the app property names defined in the Application Properties dialog in TIBCO Cloud Integration - Flogo (PAYG).
You can set the FLOGO_APP_PROPS_CONSUL environment variable either by directly entering the values as a JSON string on the command line or placing the properties in a file and using the file as input to the FLOGO_APP_PROPS_CONSUL environment variable.
Entering the Consul Parameter Values as a JSON String
To enter the Consul parameters as a JSON string, enter the parameters as key/value pairs using the comma delimiter. The following examples illustrate how to set the values as JSON strings. You would run the following from the location where your app resides:
FLOGO_APP_PROPS_CONSUL="{\"server_address\":\"http:\/\/127.0.0.1:8500\"}" ./Timer-darwin-amd64where Timer-darwin-amd64 is the name of the app binary.
FLOGO_APP_PROPS_CONSUL="{"server_address":"http://127.0.0.1:8500","key_prefix":"/dev/Timer","acl_token":"SECRET:b0UaK3bTyD9wN+ZJkmlKRmojhAv+"}"where /dev/Timer is the path and SECRET is the encrypted value of the token obtained from the Consul.
This command directs your app to connect to the Consul at the server_address and pull the values for the properties from the Consul and run your app with those values.
Refer to Consul Connection Parameters section for a description of the parameters. Refer to Encrypting Password Values for details on how to encrypt a value.
Setting the Consul Parameter Values Using a File
{ "server_address": "http://127.0.0.1:32819", "key_prefix": "/dev/<APPNAME>/", "acl_token": "SECRET:b0UaK3bTyD9wN+ZJkmlKRmojhAv+" }
You would place the consul_config.json file in the same directory which contains your app binary.
FLOGO_APP_PROPS_CONSUL=consul_config.json ./<app_binary_name>
The command extracts the Consul server connection parameters from the file and connects to the Consul to pull the app properties values from the Consul and run your app with those values.
Consul properties can also be run using docker by passing the same arguments for the docker image of a binary app.