Consul Connection Parameters
Provide the following configuration information during runtime to connect to the Consul server.
Property Name | Required | Description |
---|---|---|
server_address | Yes | Address of the Consul server which could be run locally or elsewhere in the cloud. |
key_prefix | No | Prefix to be prepended to the lookup key. This is essentially the hierarchy that your app follows to get to the Key location in the Consul. This is helpful in case key hierarchy is not fixed and may change based on environment during runtime. This is also helpful in case you want to switch to a different configuration service such as AWS param store. Although it is a good idea to include the app name in the
key_prefix, it is not required.
key_prefix can be any hierarchy that is meaningful to you.
As an example of a key_prefix, if you have an app property (for example, Message) which has two different values depending on the environment from which it is being accessed (for example dev or test environment), your <key_prefix> for the two values can be /dev/<APPNAME>/ and /test/<APPNAME>/. At run time, the right value for Message will be picked up depending on which <key_prefix> you specify in the FLOGO_APP_PROPS_CONSUL environment variable. Hence, setting a key_prefix allows you to change the values of the app properties at runtime without modifying your app. |
acl_token | No | Use this parameter if you have key access protected by ACL. Tokens specify which keys can be accessed from the Consul. You create the token on the ACL tab in Consul.
During runtime, if you use the acl_token parameter, Key access to your app will be based on the token you specify. To protect the token, encrypt the token for the key_prefix where your Key resides and provide the encrypted value of that token by prefixing the acl_token parameter with SECRET. For example, "acl_token": "SECRET:QZLOrtN3gOEpXgUuud6jprgo/WzLR7j+Twv28/4KCp7573snZWo+hGuQauuR2o/7TJ+ZLQ==". Note that the encrypted value follows the key_prefix format. Provide the encrypted value of the token as the SECRET. SECRETS get decrypted at runtime. To encrypt the token, you obtain the token from the Consul and encrypt it using the app binary by running the following command from the directory in which your app binary is located:./<app_binary> --encryptsecret <token_copied_from_Consul> |
insecure_connection | No | By default set to False. Set to true if you want to connect to a secure consul server without specifying client certificates. This should only be used in test environments. |