Skip to content

Commit 8fc88da

Browse files
committed
show valid keys in validation
1 parent 7974cd5 commit 8fc88da

File tree

1 file changed

+6
-2
lines changed
  • environments/skeleton/{{cookiecutter.environment}}/tofu/node_group

1 file changed

+6
-2
lines changed

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/variables.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,12 @@ variable "group_keys" {
151151
type = list
152152
validation {
153153
condition = length(setsubtract(var.group_keys, var.allowed_keys)) == 0
154-
error_message = "Node group '${var.group_name}' contains invalid key(s): ${
155-
join(", ", setsubtract(var.group_keys, var.allowed_keys))}"
154+
error_message = <<-EOT
155+
Node group '${var.group_name}' contains invalid key(s) ${
156+
join(", ", setsubtract(var.group_keys, var.allowed_keys))}.
157+
158+
Valid keys are ${join(", ", var.allowed_keys)}.
159+
EOT
156160
}
157161
}
158162

0 commit comments

Comments
 (0)