Files
2026-05-19 14:53:37 +02:00

52 lines
943 B
Terraform

provider "proxmox" {
endpoint = var.proxmox_endpoint
insecure = var.proxmox_insecure
api_token = trimspace(file(var.proxmox_api_token_file))
}
resource "proxmox_virtual_environment_vm" "wazuh" {
name = var.vm_name
vm_id = var.vm_id
node_name = var.proxmox_node_name
clone {
vm_id = var.proxmox_template_vm_id
full = true
datastore_id = var.proxmox_datastore_id
}
cpu {
sockets = var.vm_cpu_sockets
cores = var.vm_cpu_cores
}
memory {
dedicated = var.vm_memory_mb
}
network_device {
model = "virtio"
bridge = var.proxmox_bridge
}
initialization {
datastore_id = var.proxmox_datastore_id
user_account {
username = var.vm_ssh_username
keys = [var.vm_ssh_public_key]
}
ip_config {
ipv4 {
address = var.vm_ipv4_cidr
gateway = var.vm_gateway
}
}
}
agent {
enabled = true
}
}