@@ -52,7 +52,7 @@ variable "login" {
52
52
be useful for e.g. separating nodes for ssh and Open Ondemand usage, or
53
53
to define login nodes with different capabilities such as high-memory.
54
54
55
- Keys are names of groups.
55
+ Keys are names of groups. Keys cannot be 'login', 'compute', or 'control'.
56
56
Values are a mapping as follows:
57
57
58
58
Required:
@@ -88,6 +88,12 @@ variable "login" {
88
88
EOF
89
89
90
90
type = any
91
+ validation {
92
+ condition = length (setintersection (keys (var. login ), [" login" , " compute" , " control" ])) == 0
93
+ error_message = <<- EOF
94
+ Login nodegroup names cannot be 'login', 'compute' or 'control'. Invalid var.login keys: ${ join (" , " , setintersection (keys (var. login ), [" login" , " compute" , " control" ]))} .
95
+ EOF
96
+ }
91
97
}
92
98
93
99
variable "cluster_image_id" {
@@ -101,7 +107,7 @@ variable "compute" {
101
107
Mapping defining homogenous groups of compute nodes. Groups are used
102
108
in Slurm partition definitions.
103
109
104
- Keys are names of groups.
110
+ Keys are names of groups. Keys cannot be 'compute', 'login', 'control' or 'default'.
105
111
Values are a mapping as follows:
106
112
107
113
Required:
@@ -139,6 +145,12 @@ variable "compute" {
139
145
EOF
140
146
141
147
type = any # can't do any better; TF type constraints can't cope with heterogeneous inner mappings
148
+ validation {
149
+ condition = length (setintersection (keys (var. compute ), [" login" , " compute" , " control" , " default" ])) == 0
150
+ error_message = <<- EOF
151
+ Compute nodegroup names cannot be 'compute', 'default', 'login' or 'control'. Invalid var.compute keys: ${ join (" , " , setintersection (keys (var. compute ), [" login" , " compute" , " control" , " default" ]))} .
152
+ EOF
153
+ }
142
154
}
143
155
144
156
# tflint-ignore: terraform_typed_variables
0 commit comments