# gudshuis/proxmox-terraform-vm-template architecture

> Architecture diagram of the GitHub repository gudshuis/proxmox-terraform-vm-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gudshuis/proxmox-terraform-vm-template
- Repository: https://github.com/gudshuis/proxmox-terraform-vm-template

## Overview

This repository documents a Proxmox VM setup workflow: create an API token, configure and apply Terraform, prepare a cloud-image template, generate SSH access, clone a VM, and optionally provision packages. The graph preserves those distinct stages and the documented Proxmox and SSH interactions. Source excerpts were not provided, so relationships rely on the README; Terraform file-level behavior beyond its documented configuration role is not inferred.

Main entry points: [`main.tf`](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/main.tf) (Terraform configuration), [`0-proxmox-tokenid-secret.sh`](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/0-proxmox-tokenid-secret.sh) (Create API token), [`2-create-baigan-ssh-key.sh`](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/2-create-baigan-ssh-key.sh) (Generate SSH key), [`pve1-template.tfvars`](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/pve1-template.tfvars) (Environment variables)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_credentials["Credentials and access"]
  node_token["Create API token"]
  node_ssh_key["Generate SSH key"]
  node_ssh_config["Local SSH config"]
end

subgraph group_terraform["Terraform configuration"]
  node_tfvars["Environment variables"]
  node_provider["Provider configuration<br/>[provider.tf]"]
  node_variables["Variable declarations<br/>[variables.tf]"]
  node_terraform_config["Terraform configuration<br/>[main.tf]"]
  node_outputs["Terraform outputs<br/>[outputs.tf]"]
end

subgraph group_vm_workflow["VM provisioning"]
  node_template["Prepare VM template"]
  node_clone["Clone and configure VM"]
  node_packages["Package provisioning placeholder<br/>[4-vm-packages.sh]"]
end

node_operator(("Operator"))
node_proxmox["Proxmox host"]
node_vm["Provisioned VM"]

node_operator -->|"runs"| node_token
node_token -->|"creates API token"| node_proxmox
node_operator -->|"configures"| node_tfvars
node_operator -->|"applies"| node_terraform_config
node_tfvars -->|"supplies variables"| node_terraform_config
node_terraform_config -->|"sets up template"| node_proxmox
node_operator -->|"runs"| node_template
node_template -->|"imports image"| node_proxmox
node_operator -->|"runs"| node_ssh_key
node_ssh_key -->|"updates"| node_ssh_config
node_operator -->|"runs"| node_clone
node_clone -->|"clones template"| node_proxmox
node_proxmox -->|"creates"| node_vm
node_operator -->|"connects by SSH"| node_vm
node_operator -->|"runs optional step"| node_packages

click node_token "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/0-proxmox-tokenid-secret.sh"
click node_ssh_key "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/2-create-baigan-ssh-key.sh"
click node_ssh_config "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/2-create-baigan-ssh-key.sh"
click node_tfvars "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/pve1-template.tfvars"
click node_provider "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/provider.tf"
click node_variables "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/variables.tf"
click node_terraform_config "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/main.tf"
click node_outputs "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/outputs.tf"
click node_template "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/1-create-vm-template.sh"
click node_clone "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/3-vm-creation-from-clone.sh"
click node_packages "https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/4-vm-packages.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_token,node_ssh_key,node_ssh_config toneBlue
class node_tfvars,node_provider,node_variables,node_terraform_config,node_outputs toneAmber
class node_template,node_clone,node_packages toneMint
class node_operator,node_proxmox,node_vm toneIndigo
```

## Components

### Credentials and access

- [Create API token](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/0-proxmox-tokenid-secret.sh): `0-proxmox-tokenid-secret.sh`
- [Generate SSH key](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/2-create-baigan-ssh-key.sh): `2-create-baigan-ssh-key.sh`
- [Local SSH config](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/2-create-baigan-ssh-key.sh): `2-create-baigan-ssh-key.sh`

### Terraform configuration

- [Environment variables](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/pve1-template.tfvars): `pve1-template.tfvars`
- [Provider configuration](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/provider.tf): `provider.tf`
- [Variable declarations](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/variables.tf): `variables.tf`
- [Terraform configuration](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/main.tf): `main.tf`
- [Terraform outputs](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/outputs.tf): `outputs.tf`

### VM provisioning

- [Prepare VM template](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/1-create-vm-template.sh): `1-create-vm-template.sh`
- [Clone and configure VM](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/3-vm-creation-from-clone.sh): `3-vm-creation-from-clone.sh`
- [Package provisioning placeholder](https://github.com/gudshuis/proxmox-terraform-vm-template/blob/main/4-vm-packages.sh): `4-vm-packages.sh`

### Other components

- **Operator**
- **Proxmox host**
- **Provisioned VM**

## Connections

- Operator → Create API token: runs (evidence: `README.md`)
- Create API token → Proxmox host: creates API token (evidence: `README.md`)
- Operator → Environment variables: configures (evidence: `README.md`)
- Operator → Terraform configuration: applies (evidence: `README.md`)
- Environment variables → Terraform configuration: supplies variables (evidence: `README.md`)
- Terraform configuration → Proxmox host: sets up template (evidence: `README.md`)
- Operator → Prepare VM template: runs (evidence: `README.md`)
- Prepare VM template → Proxmox host: imports image (evidence: `README.md`)
- Operator → Generate SSH key: runs (evidence: `README.md`)
- Generate SSH key → Local SSH config: updates (evidence: `README.md`)
- Operator → Clone and configure VM: runs (evidence: `README.md`)
- Clone and configure VM → Proxmox host: clones template (evidence: `README.md`)
- Proxmox host → Provisioned VM: creates (evidence: `README.md`)
- Operator → Provisioned VM: connects by SSH (evidence: `README.md`)
- Operator → Package provisioning placeholder: runs optional step (evidence: `README.md`)
