Cubtera configuration
Configuration file
Cubtera configuration file is a config.toml
file, which should be placed by default path ~/.cubtera/config.toml
. This file contains all cubtera configuration parameters, which could be used to configure cubtera behavior. If you want to use custom configuration file, you can set it with environment variable CUBTERA_CONFIG
.
Configuration parameters priority is as follows:
- Values from
env
variables - Values from
org
lvl configuration - Values from
default
lvl configuration
Example of config.toml
file
Inventory parameters
workspace_path
- path to your workspace, where all your terraform states will be stored, default is~/.cubtera/workspace
module_path
- path to your modules, where all your terraform modules will be stored, default is~/.cubtera/workspace/modules
. This modules folder will be symlinked to every terraform unit folder, so you can use modules in your units without any additional configuration, just install them in this folder, and they will be available in every unit by path./modules
plugin_path
- path to your plugins, where all your terraform plugins will be stored, default is~/.cubtera/workspace/plugins
. This plugins folder will be symlinked to every terraform unit folder, so you can use plugins in your units without any additional configuration, just install them in this folder, and they will be available in every unit by path./plugins
inventory_path
- path to your inventory, where all your terraform inventory will be stored, default is~/.cubtera/workspace/inventory
. This should contain all your terraform units, which will be used in your infrastructure. Every unit should be placed in separate folder, and should containmain.tf
file with terraform code, andunit_manifest.json
file with unit configuration.temp_folder_path
- path to your temp files, where all your terraform temp files will be stored, default is~/.cubtera/temp
Path could be set as absolute or relative to your current working directory, if you want to use relative path, you should start it with ./
.
Dimension’s relations parameters
dim_relations
- configure relations between base dimensions, default isdome:env:dc
. String, with everydim_type
s separated by:
. Elders first. For example,[dome:env:dc]
means thatdome
dimension is a parent ofenv
, as well asenv
is a parent ofdc
.
This relation’s definition will be used to provide a right variables set for a unit, depending on a used dimension. If unit uses dc
dimension as a main, it will get all variables from dc
dimension, and all variables from parent dimension of env
type, and all variables from parent dimension of dome
type.
Dimension parent should be also defined in dc
dimension .json file, for example, if you want to use env
dimension as a parent for dc
dimension, you should define which exactly env
dimension is parent:
more about dimension’s json
definition you can read here
Development parameters
clean_cache
- cleaning cash after successful apply toggle, default isfalse
.always_copy_files
- unit files copying to cache folder for every command, default isfalse
. If enabled, all unit files will be copied to cache folder before every command, if disabled, files will be copied only forinit
command.
Deployment log parameters
dlog_db
- configures mongo database connection string, if not set, deployment log will be disableddlog_job_user_name_env
- configures environment variable name, which will be used to store job user name, if not set, will be used local host user namedlog_job_number_env
- configures environment variable name, which will be used to store job number, if not set, will be set to0
dlog_job_name_env
- configures environment variable name, which will be used to store job name, if not set, will be set tolocal
Overrides with env variables
Cubtera can be configured using environment variables, which override configuration file parameters. All environment variables should:
- Start with the
CUBTERA_
prefix - Be in uppercase
For example, to override the workspace_path
parameter, set the environment variable CUBTERA_WORKSPACE_PATH
.
Additional configuration options:
- To use a custom configuration file, set the
CUBTERA_CONFIG
environment variable. - In a
multi-organization
setup, switch organizations by setting theCUBTERA_ORG
environment variable. This will be used to find your organization-related config parameters, units, and dimensions in the inventory.