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

@@ -215,6 +215,7 @@ resource "google_compute_instance" "default" {
automatic_restart = !var.options.preemptible
on_host_maintenance = local.on_host_maintenance
preemptible = var.options.preemptible
provisioning_model = var.options.spot ? "SPOT" : null
}
dynamic "scratch_disk" {
@@ -341,6 +342,7 @@ resource "google_compute_instance_template" "default" {
automatic_restart = !var.options.preemptible
on_host_maintenance = local.on_host_maintenance
preemptible = var.options.preemptible
provisioning_model = var.options.spot ? "SPOT" : null
}
service_account {