From 299fa26c4ec87c3c3b0b414f746fc0165c31f209 Mon Sep 17 00:00:00 2001 From: Alexandros Kritikos Date: Sun, 1 Mar 2026 14:26:55 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Enhance=20variable=20descriptions?= =?UTF-8?q?=20in=20Terraform=20configuration=20for=20clarity=20and=20usabi?= =?UTF-8?q?lity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 24 +++++++++++----- variables.tf | 80 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 76 insertions(+), 28 deletions(-) diff --git a/main.tf b/main.tf index 9ddd99f..63bc259 100644 --- a/main.tf +++ b/main.tf @@ -1,12 +1,22 @@ +/** + * # Root Configuration + * + * Orchestrates the homelab infrastructure: + * - **pip** – Discovers the current public IP for firewall allowlisting. + * - **pangolin** – Deploys an Azure Linux VM as a reverse-proxy / WireGuard gateway. + * - **foundry** – Creates a Proxmox LXC container running Foundry VTT. + * - **dns** – Manages Cloudflare DNS records pointing at the Pangolin proxy. + */ + module "pip" { source = "./modules/pip" } module "pangolin" { - source = "./modules/pangolin" - ssh_pubkey = file(var.ssh_pubkey_path) + source = "./modules/pangolin" + ssh_pubkey = file(var.ssh_pubkey_path) allowed_ssh_cidrs_ipv4 = ["${module.pip.ip}/32"] - admin_username = var.admin_username + admin_username = var.admin_username } module "foundry" { @@ -20,10 +30,10 @@ module "foundry" { } module "dns" { - source = "./modules/dns" - domain_zone_id = var.domain_zone_id - domain_name = var.domain + source = "./modules/dns" + domain_zone_id = var.domain_zone_id + domain_name = var.domain pangolin-proxy-v4 = module.pangolin.public_ipv4 pangolin-proxy-v6 = module.pangolin.public_ipv6 - cdn_subdomains = ["foundry"] + cdn_subdomains = ["foundry"] } diff --git a/variables.tf b/variables.tf index f96c45a..3d6e6a5 100644 --- a/variables.tf +++ b/variables.tf @@ -1,46 +1,84 @@ variable "domain" { - type = string + description = "Root domain name managed in Cloudflare." + type = string } + variable "domain_zone_id" { - type = string + description = "Cloudflare Zone ID for the domain." + type = string } + variable "cloudflare_api_token" { - type = string - sensitive = true + description = "Cloudflare API token with DNS edit permissions." + type = string + sensitive = true +} + +variable "pve_api_url" { + description = "Proxmox VE API endpoint URL." + type = string } -variable "pve_api_url" { type = string } variable "pve_token" { - type = string - sensitive = true + description = "Proxmox VE API token in 'user@realm!tokenid=secret' format." + type = string + sensitive = true } -variable "node_name" { type = string } # e.g. "pve" -variable "datastore_id" { type = string } # e.g. "local-lvm" -variable "bridge" { type = string } # e.g. "vmbr0" +variable "node_name" { + description = "Proxmox node to deploy resources on (e.g. 'pve')." + type = string +} -variable "template_vmid" { type = number } # VMID of your template -variable "vm_id" { type = number } # VMID to assign -variable "name" { type = string } +variable "datastore_id" { + description = "Proxmox datastore for VM/container disks (e.g. 'local-lvm')." + type = string +} -variable "ssh_pubkey_path" { type = string } # e.g. "~/.ssh/id_ed25519.pub" +variable "bridge" { + description = "Proxmox network bridge for VM/container NICs (e.g. 'vmbr0')." + type = string +} + +variable "template_vmid" { + description = "VMID of the Proxmox VM template to clone." + type = number +} + +variable "vm_id" { + description = "VMID to assign to the new VM." + type = number +} + +variable "name" { + description = "Name for the VM." + type = string +} + +variable "ssh_pubkey_path" { + description = "Path to the SSH public key file (e.g. '~/.ssh/id_ed25519.pub')." + type = string +} variable "admin_username" { - type = string - default = "azureuser" + description = "Admin username for provisioned VMs." + type = string + default = "azureuser" } variable "azure_location" { - type = string - default = "westeurope" + description = "Azure region for resource deployment." + type = string + default = "westeurope" } variable "azure_subscription_id" { - type = string + description = "Azure subscription ID to deploy resources into." + type = string } variable "allowed_ssh_cidrs_ipv4" { - type = list(string) description = "IPv4 CIDRs allowed to SSH (22/tcp). Empty list means allow from anywhere." - default = [] + type = list(string) + default = [] }