Fix boot disk validation when attaching existing disk in compute-vm (#4015)

This commit is contained in:
Ludovico Magnocavallo
2026-06-07 12:14:48 +02:00
committed by GitHub
parent 4a9245d20a
commit 24775a03ae
3 changed files with 44 additions and 48 deletions

View File

@@ -85,14 +85,12 @@ variable "boot_disk" {
nullable = false
validation {
condition = (
var.boot_disk.initialize_params == null ||
(
var.boot_disk.source.attach == null &&
var.boot_disk.source.snapshot == null &&
var.boot_disk.source.disk == null
)
var.boot_disk.initialize_params != null ||
var.boot_disk.source.attach != null ||
var.boot_disk.source.snapshot != null ||
var.boot_disk.source.disk != null
)
error_message = "Initialize params cannot be used when attaching an existing disk or creating from a snapshot."
error_message = "Either initialize params or one of attach, snapshot, source disk should be specified."
}
validation {
condition = (