Post-Tyranny-Tech-Infrastru.../tofu/variables.tf
Pieter 0135bd360a Implement OpenTofu infrastructure provisioning (#1)
Completed:
-  Hetzner Cloud provider configuration
-  VPS server provisioning with for_each pattern
-  Cloud firewall rules (SSH, HTTP, HTTPS)
-  SSH key management
-  Outputs for Ansible dynamic inventory
-  Variable structure and documentation
-  Test server successfully provisioned

Deferred:
- DNS configuration (commented out, waiting for domain)

Files added:
- tofu/versions.tf - Provider versions
- tofu/variables.tf - Input variable definitions
- tofu/main.tf - Core infrastructure resources
- tofu/dns.tf - DNS configuration (optional)
- tofu/outputs.tf - Outputs for Ansible integration
- tofu/terraform.tfvars.example - Configuration template
- tofu/README.md - Comprehensive setup guide

Closes #1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 13:48:42 +01:00

45 lines
1.3 KiB
HCL

# Hetzner Cloud API Token
variable "hcloud_token" {
description = "Hetzner Cloud API Token (Read & Write)"
type = string
sensitive = true
}
# Hetzner DNS API Token (can be same as Cloud token)
variable "hetznerdns_token" {
description = "Hetzner DNS API Token"
type = string
sensitive = true
}
# SSH Public Key
variable "ssh_public_key" {
description = "SSH public key for server access"
type = string
}
# Base Domain (optional - only needed if using DNS)
variable "base_domain" {
description = "Base domain for client subdomains (e.g., platform.nl) - leave empty if not using DNS"
type = string
default = ""
}
# Client Configurations
variable "clients" {
description = "Map of client configurations"
type = map(object({
server_type = string # e.g., "cx22" (2 vCPU, 4 GB RAM)
location = string # e.g., "fsn1" (Falkenstein), "nbg1" (Nuremberg), "hel1" (Helsinki)
subdomain = string # e.g., "alpha" for alpha.platform.nl
apps = list(string) # e.g., ["zitadel", "nextcloud"]
}))
default = {}
}
# Enable automated snapshots
variable "enable_snapshots" {
description = "Enable automated daily snapshots (20% of server cost)"
type = bool
default = true
}