Summary
The password variable in modules/workloads/vm/variables.tf currently allows an empty string (""), which is treated as "set" in main.tf and can produce insecure/invalid cloud-init auth behavior. A validation block should be added to require null or a non-empty, non-whitespace string.
Proposed Fix
variable "password" {
type = string
description = "Password for the default_user, injected via chpasswd.list. Only used when user_data is null. Leave null to disable password auth."
default = null
sensitive = true
validation {
condition = var.password == null || length(trimspace(var.password)) > 0
error_message = "password must be null or a non-empty string."
}
}
References
Summary
The
passwordvariable inmodules/workloads/vm/variables.tfcurrently allows an empty string (""), which is treated as "set" inmain.tfand can produce insecure/invalid cloud-init auth behavior. A validation block should be added to requirenullor a non-empty, non-whitespace string.Proposed Fix
References