Parameters in c4
This article describes how the configuration parameters used by Exasol Deployment Tool (c4) are structured and defined.
Parameter structure
The c4 deployment tool has a large number of configurable parameters. The majority of these parameters can be left at their default values for most deployment scenarios, and many apply only to a specific deployment platform. Some parameters must however be explicitly set in order to create a deployment. The required parameters for
You can set configuration values persistently using local configuration files that are loaded when you create the deployment. You can also define configuration values specifically for each deployment by loading a custom configuration file and/or setting parameters on the command line. For more details, see Setting parameters.
The configuration parameters are organized into modules that indicate in which context they are applied, such as USER for parameters related to the user. Parameter names start with CCC_<MODULE>_
to clearly indicate which context the belong in, for example, CCC_USER_PASSWORD
.
Get info about parameters
To view all the available parameters in c4, use the command c4 config -F
. This command returns a complete list of all parameters and their current values, including parameters that are not relevant for your deployment platform.
To learn more about specific parameters, use c4 config -K <string>
, where <string
> is the full or partial name of a parameter (case-insensitive).
For example, to get a description of all parameters in the CCC_PLAY
module, use c4 config -K ccc_play
. To get all parameters that contain “key
” in their names, use c4 config -K key
.
./c4 config -K ccc_play
Found 93 results for query `ccc_play`:
CCC_PLAY_DIR (string)
Location of play directories (playgrounds).
Default value : /home/username/.ccc/play
Current value : [empty]
JSON/YAML name: play.dir
CCC_PLAY_DATADISK_DEFAULT_SIZE (int)
Default size of the data disk used for play images (in GiB).
Default value : 16
Current value : [empty]
JSON/YAML name: play.datadisk_default_size
...
To learn more about how to use the config
command, use c4 config --help
.
Setting parameters
Configuration parameter values can be set in configuration files using shell, JSON, or YAML format. The configuration file config located in the installation directory will be loaded by default. You can also specify a configuration file to be loaded by adding the path to the file on the command line when you create the deployment. Individual parameters can also be set on the command line as environment variables before the command or as command-line options.
Options on the command line can be absolute or relative. An absolute option can be specified anywhere in the command. A relative option must be preceded by the module name. The module name can be followed by multiple (relative) options, see examples below.
When creating a deployment, the parameter values are loaded in the following order of precedence:
- User configuration file
- Configuration file loaded on the command line
- Environment variables
- Command-line parameters
For example, a parameter value set in an environment variable will override the value for the same parameter specified in a configuration file, but will be overridden by a value set on the command line.
Parameter formats
Parameters are formatted differently depending on where they are specified:
Location | Format | Example |
---|---|---|
Shell config file | Use the full parameter name in UPPERCASE. | CCC_PLAY_DATABASE_NAME=my_db
|
JSON or YAML config file |
Exclude the Must be placed in a subsection for the corresponding module. |
play: |
Environment variable | Use the full parameter name in UPPERCASE. | CCC_PLAY_DATABASE_NAME=my_db
|
Command-line option (absolute) |
Replace |
c4 play --ccc-play-database-name my_db ...
|
Command-line option (relative) |
Exclude the Must be preceded by the module name. |
c4 play --database-name my_db --db-password j8IUgef7_IJz9 ...
|
Parameter data types
Each parameter has a defined data type that it accepts for the value. The type is automatically validated when a parameter value is changed. The available types are:
Type | Format | Example |
---|---|---|
string | Can contain text or numbers. If the string contains spaces, it must be enclosed in quotation marks. |
|
int | Number (integer) | CCC_PLAY_DB_PORT=8563
|
bool | true or false |
|
list |
A list of strings. When specified in environment variables, list values must be entered as space-separated strings. Values that contain spaces must be enclosed in quotation marks. When defined on the command line, list values must be specified by repeating the parameter name for each element. |
Examples
-
User configuration file
The user configuration file is located in
$HOME/.ccc
and can use shell, YAML, or JSON format. The default filename is config.-
$HOME/.ccc/config
-
$HOME/.ccc/config.yaml
-
$HOME/.ccc/config.json
Example of a configuration file in shell format:
$ cat $HOME/.ccc/config
CCC_USER_EMAIL=firstname.lastname@exasol.com
CCC_HOST_EXTERNAL_ADDRS="198.51.100.11 198.51.100.12 198.51.100.13"
CCC_HOST_DATADISK=/dev/mapper/exasol_disk_1,/dev/mapper/exasol_disk_2
CCC_PLAY_WORKING_COPY=@exasol-8.22.0To update the configuration file, open the file using a text editor and add a new line using the one of the supported formats. Afterwards, save the file. The configuration is updated immediately.
To confirm that the configuration is valid, use
c4 config --validate
.The parameter values specified in the user configuration file will be used by default in every c4 statement, unless another value is specified in one of the locations specified below.
-
-
Command configuration file
You can define parameters in a file in shell, YAML, or JSON format and load this file into c4 using
CCC_CONFIG
on the command line. The parameter values specified in this file will override the default values and values set in the user configuration file.Parameters for a specific module must be added within a corresponding subsection of the file. For example, the following YAML file specifies the database name and password:
When running a command, specify
CCC_CONFIG
and the name of the configuration file. For example: -
Command-line parameters
Parameter values can be specified on the command line as part of a c4 command. This is useful if you want to specify parameters that are only used for one command and should not be persisted.
Relative parameters for a specific module must be added immediately after the module name in the command. For example, when creating a deployment, you can specify the database name (
--database-name
) and the database password. These parameters--database-name
are a configuration of the PLAY module, and must therefore be preceded by theplay
command:Alternatively, you can reference the absolute parameter names and list them anywhere in the c4 command. For example: