variable "instance_mode" { type = string description = "single or multiple" validation { condition = contains(["single", "multiple"], var.instance_mode) error_message = "instance_mode must be either single or multiple." } } variable "instance" { type = object({ service_name = string vm_name = string node_name = string vm_cpu = optional(number) vm_ram = optional(number) vm_size = optional(string) vm_tags = optional(list(string)) }) default = null nullable = true description = "Used only when instance_mode = single." } variable "instances" { type = map(object({ service_name = string vm_name = string node_name = string vm_cpu = optional(number) vm_ram = optional(number) vm_size = optional(string) vm_tags = optional(list(string)) })) default = {} nullable = false description = "Used only when instance_mode = multiple." } variable "vm_defaults" { type = object({ node_datastore = string vm_bios = string vm_machine = string vm_user_sshkey = string bridge = string vm_cpu = number vm_ram = number vm_size = number }) default = { node_datastore = "hlst" vm_bios = "ovmf" vm_machine = "q35" bridge = "vmbr0" vm_cpu = 2 vm_ram = 4096 vm_size = 20 } } variable "pm_api_url" { default = "https://192.168.10.201:8006/api2/json" } variable "pm_api_token" { default = "terraform@pve!provider=760580c4-5c1f-462b-986a-dd244c6c95f2" }