Environment Variables

It is possible to configure a set of variables such that the values of the Variable will change depending on the Environment which the GLU.Engine is run on. This allows the user to not set fixed values inside the configuration itself and then need to change this during the lifecycle of your engine.

An example of this is if you want to change a Slack channel which messages are sent to depending on whether you are deploying on a development environment or a production environment. It is possible to have a single variable name such as “slackKeyValue” with the channel keys for development and production being different.

How to set this up:

1. Setup your Global Variables

Press the “Global Variables” button in the Environments tool, to access the Variable configuration screen.

The Global Variables screen shows the variables that exist. It is possible to “Add Variables”, and to modify and delete existing variables from this screen. Each Variable must have a unique name per Client, with a description of what the variable is used for.

If you add or modify a variable you will be presented with the ‘Edit Variable’ dialogue.

In this dialogue, you can define/modify the name of the variable and description. For each environment, you can set the value to be used. It is not necessary to enter values for Environments that are not used. If the value is left empty, then null will be present in the GLU.Engine when used in that environment. Once Variables have been set per environment, those variables will be used for each GLU.Engine Environment-specific build.

2. Use the variable in your integration

The variable that you have created is now available to be used in your integration. It will be added to the parameter dropdown box with the prefix “env_” .

Example of global variables that will be present in the pulldown box with the “env_” prefix:

Example of using a global variable in the context name:

/${header.env_slackKeyValue} … where the variable defined was slackKeyValue and the env_ is the prefix to identify the variable as a global variable and the /${header. represents part of the parameter being passed to the URI.

Masking Environment Variables in the logs

See how the values are masked in the logs

Note: avoid using variables in Header, Body, or query sections endpoint calls, as they will not be encrypted when presented in the logs.

Using an Environment Variable in a Handler

Where an Environment Variable needs to have a condition applied and Action taken, when in the Integration Builder, and configuring the Handler, select the Environment Variable from the Parameter Name drop-down.

See the example below.

Was this article helpful?

Related Articles

Fill the form and we’ll contact you shortly

    I agree with

    We uses cookies to make your experience on this website better. Learn more
    Accept cookies