This example demonstrates most of the working configurations you can give to a virtual machine. Within locals.tf
, there's a long list of variables and what said variable does.
Example 1: Using token and secret
# Using API Token & Secret example:
export PM_API_URL="https://pve1.yourdomain.com:8006/api2/json"
export PM_API_TOKEN_ID="svc-acc-terraform@pam!svc-acc-token-id"
export PM_API_TOKEN_SECRET="12341234-1234-1234-1234-123412341234"
Example 2: Using username and password
# Using username and password example:
export PM_API_URL="https://pve1.yourdomain.com:8006/api2/json"
export PM_USER="svc-acc-terraform@pam"
export PM_PASS="proxmox_account_password"
Rename terraform.tfvars.example
to terraform.tfvars
. Once renamed, modify the three variables within the file to match your environment.
Once you've populated the required variables in terraform.tfvars
, you may open locals.tf
to see all of the variables you may modify.
Run the following commands to deploy said Virtual Machine
terraform init
terraform plan
terraform apply
Name | Version |
---|---|
terraform | >=1.3.0 |
proxmox | 2.9.14 |
No providers.
Name | Source | Version |
---|---|---|
cloudinit_vm | ../../ | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
clone | The base VM from which to clone to create the new VM. Note that clone is mutually exclussive with pxe and iso modes. | string |
n/a | yes |
storage_location | The storage location for the Virtual Machine. | string |
n/a | yes |
target_node | The name of the Proxmox Node on which to place the VM. | string |
n/a | yes |
Name | Description |
---|---|
disks | The Disk(s) affiliated with said Virtual Machine. |
ip | The Virtual Machine's IP on the first Network Adapter. |
name | The Virtual Machine's name. |
nics | The Network Adapter(s) affiliated with said Virtual Machine. |
node | The Proxmox Node the Virtual Machine was created on. |
ssh | The Virtual Machine's SSH Settings. |
template | The name of the template in which the Virtual Machine was created on. |
vmid | The Virtual Machine's Id. |