The Cognite Toolkit injects environment variables in theDocumentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
cdf deploy/clean/pull commands. You don’t need to declare environment variables. The Cognite Toolkit will inject all the variables into the OS environment. The syntax
for injecting environment variables is ${MY_ENV_VAR} and you can place it anywhere in the configuration file.
For example, if you have the following configuration file for a workflow trigger:
my_trigger.WorkflowTrigger.yaml
cdf deploy command, the Cognite Toolkit injects the environment variables into the configuration file.
my_trigger.WorkflowTrigger.yaml
Environment variables with build variables
The environment variables are independent of the build variables specified in theconfig.[env].yaml file and used in the cdf build command.
You can combine the environment and build variables together.
For example, you can define a function schedule in modules/my_module/functions/my_function.Function.yaml:
my_function.Function.yaml
config.dev.yaml file, you’ll have the following build variables:
config.dev.yaml
cdf build command, the Cognite Toolkit replaces the {{ functionClientId }} and {{ functionClientSecret }} with the environment variable placeholders. Hence, after running cdf build, your function schedule configuration in build/functions/1.my_function.Function.yaml will look like:
my_function.Function.yaml
cdf deploy command, specify the environment variables, IDP_FUNCTION_CLIENT_ID and IDP_FUNCTION_CLIENT_SECRET.
The Cognite Toolkit will inject these environment variables into the configuration file.
my_function.Function.yaml