Global Variables
The following global variables are available within togomak:
togomak.*
Introduced in Togomak v1.0.0
See Togomak Block for a list of attributes the togomak block returns.
pipeline.*
Introduced in Togomak v1.0.0
pipeline.id- A UUID created and exported per pipeline run, which can be useful, to filter out logs for a particular pipeline given the UUID.pipeline.path- Path totogomak.hclpipeline which initiated the buildpipeline.tempDir- Temporary workspace directory created by togomak at the beginning of execution
cwd
Introduced in Togomak v1.0.0, Deprecated: Use path.root instead
cwd returns the directory where the togomak.hcl configuration file exists. This is actually the directory
evaluated after --chdir was executed, otherwise same as owd
owd
Introduced in Togomak v1.0.0, Deprecated: Use path.cwd instead
owd returns the directory where the togomak command was invoked, i.e, before the --chdir flag was evaluated.
host*
Introduced in Togomak v1.0.0, Deprecated: Use path.cwd instead
path.*
Introduced in Togomak v2.0.0-alpha.5
Exports path related variables in togomak, similar to that of Terraform:
path.root- The path where the togomak configuration files exist.path.cwd- The path where the togomak command was executed, before evaluating--chdirflag, if it was provided, else, same aspath.root.path.module- The path to the module, which was imported.
These variables are directly influenced from OpenTofu implementation itself, see Filesystem and Workspace Info
ansi.*
Introduced in Togomak v1.5.0
Provides helper variables for ANSI term colors, the following colors and variables are supported:
ansi.bg.red- returns\033[41m, the sequence for red backgroundansi.fg.red- returns\033[31m, the sequence for red foreground
The supported background and foreground colors are:
ansi.bg.redansi.bg.greenansi.bg.yellowansi.bg.blueansi.bg.purpleansi.bg.cyanansi.bg.whiteansi.bg.greyansi.fg.redansi.fg.greenansi.fg.yellowansi.fg.blueansi.fg.purpleansi.fg.cyanansi.fg.whiteansi.fg.greyansi.fg.boldansi.fg.italicansi.fg.underlineansi.reset
ansi.reset is a special sequence which returns [0m which terminates the previous color.
There is also ansifmt helper function, see ansifmt Function