Support multiple variable types in IaCM Workspace tfVars (map, list, object, boolean)
M
Mint Partridge
Description:
Currently, Harness IaCM only supports string-type variables in workspace configurations under tfVars. This limitation causes issues when Terraform modules require structured types like maps, lists, or objects.
When users pass JSON objects as variable values, Harness automatically escapes them as strings, leading to invalid Terraform syntax. For example:
tfVars:
tags: '{"CostCenter":"X","Department":"Cloud COE"}'
is rendered as:
"tags": "{\"CostCenter\":\"X\",\"Department\":\"Cloud COE\"}"
Terraform expects the variable as an object, not as an escaped string:
"tags": {
"CostCenter": "X",
"Department": "Cloud COE"
}
This behavior breaks IaC workflows that rely on complex or nested variable structures.
Impact:
Blocks customers from using non-string variable types in Harness IaCM Workspaces.
Affects Terraform configurations expecting native objects, lists, or maps.
Causes execution failures and forces customers to use error-prone manual workarounds (e.g., replacing escaped quotes).
Suggested Enhancement:
Enable multi-type support for workspace tfVars by allowing definitions such as:
tfVars:
additionalProperties:
type: string | map | list | object | boolean
This will allow structured variable passing to Terraform without escaping, aligning Harness IaCM behavior with Terraform native variable typing.
Log In