compute-vm: Add graceful shutdown configuration and some missing GPUs.

This commit is contained in:
Taneli Leppä
2025-03-26 12:23:31 +01:00
committed by Wiktor Niesiobędzki
parent d487590e01
commit ccecc32718
3 changed files with 59 additions and 25 deletions

View File

@@ -313,6 +313,21 @@ resource "google_compute_instance" "default" {
values = affinity.value.values
}
}
dynamic "graceful_shutdown" {
for_each = var.options.graceful_shutdown != null ? [""] : []
content {
enabled = var.options.graceful_shutdown.enabled
dynamic "max_duration" {
for_each = var.options.graceful_shutdown.enabled == true && var.options.graceful_shutdown.max_duration_secs != null ? [""] : []
content {
seconds = var.options.graceful_shutdown.max_duration_secs
nanos = 0
}
}
}
}
}
dynamic "scratch_disk" {
@@ -519,6 +534,20 @@ resource "google_compute_instance_template" "default" {
values = affinity.value.values
}
}
dynamic "graceful_shutdown" {
for_each = var.options.graceful_shutdown != null ? [""] : []
content {
enabled = var.options.graceful_shutdown.enabled
dynamic "max_duration" {
for_each = var.options.graceful_shutdown.enabled == true && var.options.graceful_shutdown.max_duration_secs != null ? [""] : []
content {
seconds = var.options.graceful_shutdown.max_duration_secs
nanos = 0
}
}
}
}
}
dynamic "service_account" {