env
Provider
ℹ️
Introduced in Togomak v1.0.0
The data.env
provider fetches variables from the host runtime environment.
Example
togomak {
version = 2
}
data "env" "home" {
key = "HOME"
default = "nowhere"
}
stage "hello" {
script = "echo my home is ${data.env.home.value}"
}
Usage
The data.env
block accepts the following arguments:
-
default
- Optional, specifies the fallback value if the key specified inkey
does not exist. In the case where thekey
does not exist in the host environment, and if thedefault
argument is not defined, thedata.env
provider will return an error. -
key
- Required,
Arguments Reference
key
: The environment variable key which needs to be fetched fromos.environ
default
: Fallback definition, which will be returned ifos.environ[key]
is undefined.
Attributes Reference
- [
value
]: The value from the environment variable defined inkey