Set Environment Variables
Give an integration environment variables, written in the setting or read from a stored configuration.
How it works
Environment variables are read by the runtime, by libraries, and by routes through {{env:NAME}}. Use them for the few values software expects in that form; prefer property files for the settings of your routes.
A variable typed here is stored in clear
For a secret value, read the variable from a stored configuration instead of typing it.
Prerequisites
- An integration, created and bound to an environment.
Procedure
- In Runtime Manager, go to Integrations and open the integration.
- Choose Add Capability, then Environment.
- In Environment Variables, add one variable per line:
NAME=value, orNAME=secret:configuration/keyto read a stored value. - Choose Apply changes.
Parameters
| Field | What it is | Default |
|---|---|---|
| Environment Variables | One per line: NAME=value, or NAME=secret:name/key. | — |
| Inject Container Metadata | Give the integration its namespace and instance name, as NAMESPACE and POD_NAME. | On |
| Propagate HTTP Proxy | Pass the proxy settings of the environment on to the integration. | On |
Verification
Reading a variable in a route
- setBody:
simple: "${env:ORDERS_REGION}"
Behavior and limits
- Applying this setting restarts the integration; it does not rebuild its image.
- A value written in the setting is visible to anyone who can see the integration: read sensitive values from a stored configuration.
See also
- Integrations: every setting at a glance
- Give an integration properties