krustyplanet.org/terraform
Jezza Hehn 8b0c095c50 slim terraform to match reality: server-only config
- Removed network, floating IP, volume, firewall, cloud-init (overkill for current setup)
- Matched config to actual server: cpx11, ash, krusty-clearnet
- Imported existing server (125941041) into Terraform state
- Applied labels (project=krustyplanet, role=web)
- Added outputs.tf for server_id, ipv4, location
- Added .gitignore for tfvars/state/secrets
2026-04-13 23:14:16 +00:00
..
.gitignore Add lock file, example tfvars, fix .gitignore 2026-04-13 22:22:25 +00:00
.terraform.lock.hcl Add lock file, example tfvars, fix .gitignore 2026-04-13 22:22:25 +00:00
main.tf slim terraform to match reality: server-only config 2026-04-13 23:14:16 +00:00
outputs.tf slim terraform to match reality: server-only config 2026-04-13 23:14:16 +00:00
README.md Add Terraform configuration for KrustyPlanet VPS 2026-04-13 22:14:11 +00:00
terraform.tfvars.example fix: CORS proxy config, cloud-init variable expansion, contact-api nginx snippet 2026-04-13 22:23:18 +00:00
variables.tf slim terraform to match reality: server-only config 2026-04-13 23:14:16 +00:00

KrustyPlanet Terraform

Terraform configuration for the KrustyPlanet VPS on Hetzner Cloud.

What's Managed

  • Hetzner server (CPX22, Ubuntu 24.04)
  • Floating IP (87.99.133.81)
  • Firewall rules (80, 443, 22)
  • Persistent volume (40GB)
  • nginx reverse proxy
  • contact-api (Node.js email backend)
  • SSL certificates (Let's Encrypt)

Usage

# Initialize
terraform init

# Validate
terraform validate

# Plan
terraform plan

# Apply
terraform apply

Variables

See variables.tf for all configurable variables.

Sensitive variables are stored in terraform.tfvars.

Files

  • main.tf — Main Terraform configuration
  • variables.tf — Variable definitions
  • provider.tf — Provider configuration
  • terraform.tfvars — Sensitive variable values (gitignored)
  • cloud-init.yaml.tpl — Server bootstrap script
  • nginx.conf.tpl — nginx configuration template
  • contact-api.conf.tpl — contact-api proxy configuration
  • contact-api.service.tpl — contact-api systemd service

Notes

  • Do NOT run terraform apply unless you want to recreate the server
  • Existing VPS configuration is preserved; this Terraform config will be used for future provisioning
  • SSL certificates are provisioned via Let's Encrypt
  • The floating IP is attached to the server and will survive rebuilds