Adds Spot VM support to compute-vm

This commit is contained in:
Simone Ruffilli
2022-05-04 09:48:31 +02:00
parent 14f641f8a3
commit be54fe31d7
3 changed files with 46 additions and 10 deletions

View File

@@ -190,11 +190,17 @@ variable "options" {
allow_stopping_for_update = bool
deletion_protection = bool
preemptible = bool
spot = bool
})
default = {
allow_stopping_for_update = true
deletion_protection = false
preemptible = false
spot = false
}
validation {
condition = !var.options.spot || (var.options.spot && var.options.preemptible)
error_message = "Variable var.option.preemptible should be `true` when var.options.spot is set to `true`."
}
}