Parameters in c4

This section provides an overview of how configuration parameters in 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 set in order to create a deployment.

You can set configuration values persistently using local configuration files, and/or specifically for each deployment by setting parameters on the command line. For more details, see Parameters in c4.

The parameters are organized into modules that indicate in which context they are applied, such as USER or PLAY. The parameter names start with CCC_<MODULE>_. For example:

Parameter Description
CCC_USER_EMAIL Email address to be used for deployment tagging
CCC_PLAY_ACCESS_NODE Boolean for including an access node in the deployment. If this option is unset or set to false an access node will not be deployed.

The full list of available parameters in c4 can be viewed using the command c4 config -F.

To learn more about specific parameters, use c4 config -K <string>, where <string> is the full or partial name of a parameter. The value is 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 “PASSWORD” in their names, use c4 config -K password.

To learn more about how to use the config command, use c4 config --help.

Parameter Setting

Configuration parameters can be specified in configuration files using shell, JSON, or YAML format, on the command line as environment variables before the command, and 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.

Parameter values are loaded from the different locations in the following order:

  1. User configuration file
  2. Configuration file loaded on the command line
  3. Environment variables
  4. 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 must be 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 CCC_<MODULE> prefix, use lowercase.

Must be placed in a subsection for the corresponding module.

database_name: my_db
Environment variable Use the full parameter name in UPPERCASE. CCC_PLAY_DATABASE_NAME=my_db
Command-line option (absolute)

Replace _ (underscore) with - (dash), use lowercase.

c4 play --ccc-play-database-name my_db ...
Command-line option (relative)

Exclude the CCC_<MODULE> prefix, replace _ (underscore) with - (dash), use lowercase.

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 CCC_PLAY_ACCESS_NODE=true

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.
For example: CCC_MODULE_PARAM='A "B C"'

When defined on the command line, list values must be specified by repeating the parameter name for each element.
For example: --param=A --param='B C' or --param={a,"B C"}