Enhance module documentation with detailed descriptions for DNS, Foundry, Pangolin, and Public IP modules

This commit is contained in:
2026-03-01 14:26:44 +02:00
parent b11172504d
commit 0928b59bda
7 changed files with 79 additions and 32 deletions

View File

@@ -1,3 +1,11 @@
/**
* # DNS Module
*
* Manages Cloudflare DNS records for the root domain:
* - A / AAAA records for the apex and wildcard pointing at the Pangolin proxy.
* - CDN-proxied A / AAAA records for selected subdomains.
*/
terraform { terraform {
required_providers { required_providers {
cloudflare = { cloudflare = {

View File

@@ -1,17 +1,21 @@
variable "domain_zone_id" { variable "domain_zone_id" {
type = string description = "Cloudflare Zone ID for the target domain."
type = string
} }
variable "domain_name" { variable "domain_name" {
type = string description = "Root domain name (e.g. 'example.com')."
type = string
} }
variable "pangolin-proxy-v4" { variable "pangolin-proxy-v4" {
type = string description = "IPv4 address of the Pangolin reverse-proxy."
type = string
} }
variable "pangolin-proxy-v6" { variable "pangolin-proxy-v6" {
type = string description = "IPv6 address of the Pangolin reverse-proxy."
type = string
} }
variable "cdn_subdomains" { variable "cdn_subdomains" {

View File

@@ -1,3 +1,10 @@
/**
* # Foundry Module
*
* Creates a Proxmox LXC container running Foundry Virtual Tabletop.
* Supports configurable resources, networking, and static or DHCP addressing.
*/
terraform { terraform {
required_providers { required_providers {
proxmox = { proxmox = {

View File

@@ -1,3 +1,10 @@
/**
* # Pangolin Module
*
* Deploys an Azure Linux VM with dual-stack (IPv4 + IPv6) networking,
* intended as a reverse-proxy and WireGuard gateway for the homelab.
*/
terraform { terraform {
required_providers { required_providers {
azurerm = { azurerm = {

View File

@@ -1,11 +1,14 @@
output "public_ipv4" { output "public_ipv4" {
value = azurerm_public_ip.pip_v4.ip_address description = "The static public IPv4 address of the Pangolin proxy."
value = azurerm_public_ip.pip_v4.ip_address
} }
output "public_ipv6" { output "public_ipv6" {
value = azurerm_public_ip.pip_v6.ip_address description = "The static public IPv6 address of the Pangolin proxy."
value = azurerm_public_ip.pip_v6.ip_address
} }
output "ssh_ipv4" { output "ssh_ipv4" {
value = "ssh ${var.admin_username}@${azurerm_public_ip.pip_v4.ip_address}" description = "Ready-to-use SSH command for connecting to the VM over IPv4."
value = "ssh ${var.admin_username}@${azurerm_public_ip.pip_v4.ip_address}"
} }

View File

@@ -1,20 +1,24 @@
variable "location" { variable "location" {
type = string description = "Azure region for all resources in this module."
default = "westeurope" type = string
default = "westeurope"
} }
variable "environment" { variable "environment" {
type = string description = "Deployment environment label (e.g. 'prod', 'staging')."
default = "prod" type = string
default = "prod"
} }
variable "instance" { variable "instance" {
type = string description = "Instance identifier appended to resource names."
default = "homelab" type = string
default = "homelab"
} }
variable "tags" { variable "tags" {
type = map(string) description = "Tags applied to all Azure resources in this module."
type = map(string)
default = { default = {
project = "pangolin" project = "pangolin"
env = "prod" env = "prod"
@@ -22,47 +26,54 @@ variable "tags" {
} }
variable "vm_name" { variable "vm_name" {
type = string description = "Name of the Azure Linux VM."
default = "pangolin-proxy" type = string
default = "pangolin-proxy"
} }
variable "vm_size" { variable "vm_size" {
type = string description = "Azure VM size/SKU."
default = "Standard_A2_v2" type = string
default = "Standard_A2_v2"
} }
variable "admin_username" { variable "admin_username" {
type = string description = "Admin SSH username for the VM."
default = "azureuser" type = string
default = "azureuser"
} }
variable "ssh_pubkey" { variable "ssh_pubkey" {
type = string description = "SSH public key content for the admin user."
type = string
} }
variable "vnet_cidr_ipv4" { variable "vnet_cidr_ipv4" {
type = string description = "IPv4 address space for the virtual network."
default = "10.50.0.0/16" type = string
default = "10.50.0.0/16"
} }
variable "vnet_cidr_ipv6" { variable "vnet_cidr_ipv6" {
type = string description = "IPv6 address space for the virtual network."
default = "fd7d:bb99:1da4::/48" type = string
default = "fd7d:bb99:1da4::/48"
} }
variable "subnet_cidr_ipv4" { variable "subnet_cidr_ipv4" {
type = string description = "IPv4 CIDR for the VM subnet."
default = "10.50.1.0/24" type = string
default = "10.50.1.0/24"
} }
variable "subnet_cidr_ipv6" { variable "subnet_cidr_ipv6" {
type = string description = "IPv6 CIDR for the VM subnet."
default = "fd7d:bb99:1da4:195::/64" type = string
default = "fd7d:bb99:1da4:195::/64"
} }
variable "allowed_ssh_cidrs_ipv4" { variable "allowed_ssh_cidrs_ipv4" {
type = list(string)
description = "IPv4 CIDRs allowed to SSH (22/tcp). Empty list means allow from anywhere." description = "IPv4 CIDRs allowed to SSH (22/tcp). Empty list means allow from anywhere."
default = [] type = list(string)
default = []
} }

View File

@@ -1,3 +1,10 @@
/**
* # Public IP Module
*
* Discovers the caller's public IPv4 address using an external echo-IP service.
* Used to dynamically allowlist the deployer's IP in firewall rules.
*/
terraform { terraform {
required_providers { required_providers {
http = { } http = { }