config.[env].yaml configuration file
Expected location: config.[env].yaml
adjacent to the modules/
directory.
The config.[env].yaml
file configures the modules for a specific environment. It's in YAML format in the same directory as the modules/
directory. You'll likely have at least one config.[env].yaml
for each CDF project in your organization.
environment:
name: dev
project: demo
type: dev
selected: - modules/
variables:
modules:
cdf_ingestion:
workflow: ingestion
groupSourceId: b89b117a-9f2e-4588-b7dc-bee39f2258d8
pandidContextualizationFunction: contextualization_p_and_id_annotater
contextualization_connection_writer: contextualization_connection_writer
instanceSpaces: - springfield_instances - cdf_cdm_units
The environment
section
The environment
section specifies the configuration of a CDF project.
-
name
(string): a descriptive name of the environment. The Cognite Toolkit doesn't use the string. -
project
(string): the name of the CDF project. -
type
(string): the type of environment, for example,dev
,test
,staging
,qa
, orprod
. The toolkit strictly validates all environments exceptdev
. For instance, if the environment variableCDF_PROJECT
doesn't match theproject
value, the toolkit throws an error in all environments exceptdev
. -
selected
(list): a list of modules to include in the configuration. You can override the list using the--modules
/-m
flag in thebuild
command.An entry in the list can be either a module name, for example,
cdf_ingestion
, or a path. If it's a path, it must be relative to the organization directory.If you specify a path, all modules in subdirectories are included. Using
modules/
as an entry will include all modules in themodules/
directory and all subdirectories.
The variables
section
The variables
section contains variables used by the cdf build
command.
You can use variables to define values used in multiple places in the configuration. For example, when creating a data model, it's helpful to specify the space
as a variable since it's also referred to in containers, views, nodes, and data models. If the space name changes, you only need to update it in one place.
You can also use variables to define values that differ depending on the environment. For example, when you set up authentication, you can have a variable for sourceId
that differs in dev
and prod
CDF projects.
The toolkit uses the variables when you create module templates with either cdf modules init
or cdf modules add
to show which values must be filled in by the user.
Specifying variables
Variables are organized as key-value pairs. This example has a variable named space
with the value my_space
;
variables:
modules:
space: my_space