resource "proxmox_virtual_environment_vm" "example" { cloud_init { dns { server = "1.1.1.1" } ip_config { ipv4 { address = "dhcp" } } user_account { keys = ["${trimspace(tls_private_key.example.public_key_openssh)}"] password = "proxmoxtf" username = "ubuntu" } } disk { datastore_id = "${element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm"))}" file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" } network_device {} node_name = "${data.proxmox_virtual_environment_nodes.example.names[0]}" os_type = "l26" pool_id = "${proxmox_virtual_environment_pool.example.id}" vm_id = 2038 } resource "local_file" "example_ssh_private_key" { filename = "${path.module}/autogenerated/id_rsa" sensitive_content = "${tls_private_key.example.private_key_pem}" } resource "local_file" "example_ssh_public_key" { filename = "${path.module}/autogenerated/id_rsa.pub" sensitive_content = "${tls_private_key.example.public_key_openssh}" } resource "tls_private_key" "example" { algorithm = "RSA" rsa_bits = 2048 } output "resource_proxmox_virtual_environment_vm_example_id" { value = "${proxmox_virtual_environment_vm.example.id}" }