The environment block β
Use the environment block to define a deployment environment in your Terramate project. Environments let you model promotion workflows (e.g., dev -> staging -> production) and associate stacks with specific deployment targets.
The environment block does not support labels or nested blocks.
Arguments β
id(required, string) - A unique identifier for the environment.name(required, string) - A human-readable name for the environment.description(optional, string) - A description of the environment's purpose.promote_from(optional, string) - The ID of the environment that promotes into this one, defining a promotion chain.
Syntax β
hcl
environment {
id = "dev"
name = "Development"
description = "Development environment"
}Examples β
Define a promotion chain β
hcl
# environments/dev.tm.hcl
environment {
id = "dev"
name = "Development"
description = "Development environment for testing changes"
}
# environments/staging.tm.hcl
environment {
id = "staging"
name = "Staging"
description = "Pre-production environment"
promote_from = "dev"
}
# environments/prod.tm.hcl
environment {
id = "prod"
name = "Production"
description = "Production environment"
promote_from = "staging"
}