150 lines
4.4 KiB
HCL
150 lines
4.4 KiB
HCL
# =============================================================================
|
|
# Provider Configuration
|
|
# =============================================================================
|
|
|
|
variable "do_token" {
|
|
description = "DigitalOcean API token"
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
# =============================================================================
|
|
# Project Configuration
|
|
# =============================================================================
|
|
|
|
variable "project_name" {
|
|
description = "Project name used for resource naming"
|
|
type = string
|
|
default = "realms"
|
|
}
|
|
|
|
variable "environment" {
|
|
description = "Environment name (production, staging, development)"
|
|
type = string
|
|
default = "production"
|
|
|
|
validation {
|
|
condition = contains(["production", "staging", "development"], var.environment)
|
|
error_message = "Environment must be one of: production, staging, development."
|
|
}
|
|
}
|
|
|
|
variable "region" {
|
|
description = "DigitalOcean region"
|
|
type = string
|
|
default = "nyc3"
|
|
}
|
|
|
|
# =============================================================================
|
|
# VPC Configuration (reference existing VPC)
|
|
# =============================================================================
|
|
|
|
variable "vpc_uuid" {
|
|
description = "UUID of the existing VPC (from terraform/ outputs)"
|
|
type = string
|
|
}
|
|
|
|
variable "vpc_ip_range" {
|
|
description = "IP range for the VPC (CIDR notation)"
|
|
type = string
|
|
default = "10.10.0.0/16"
|
|
}
|
|
|
|
# =============================================================================
|
|
# SSH Configuration
|
|
# =============================================================================
|
|
|
|
variable "admin_ssh_public_keys" {
|
|
description = "Map of admin SSH public keys (name => public_key)"
|
|
type = map(string)
|
|
default = {}
|
|
}
|
|
|
|
variable "app_ssh_port" {
|
|
description = "SSH port for the app server (VPC only, non-standard)"
|
|
type = number
|
|
default = 51234
|
|
}
|
|
|
|
# =============================================================================
|
|
# App Server Configuration
|
|
# =============================================================================
|
|
|
|
variable "app_droplet_size" {
|
|
description = "Size slug for the app server droplet"
|
|
type = string
|
|
default = "s-2vcpu-4gb"
|
|
}
|
|
|
|
variable "app_droplet_image" {
|
|
description = "Image slug for the app server droplet"
|
|
type = string
|
|
default = "debian-12-x64"
|
|
}
|
|
|
|
variable "app_domain" {
|
|
description = "Domain name for the app (e.g., realms.pub)"
|
|
type = string
|
|
default = "realms.pub"
|
|
}
|
|
|
|
# =============================================================================
|
|
# DNS Configuration
|
|
# =============================================================================
|
|
|
|
variable "manage_dns" {
|
|
description = "Whether to manage DNS records via DigitalOcean"
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "dns_zone" {
|
|
description = "DNS zone (base domain) managed by DigitalOcean"
|
|
type = string
|
|
default = "realms.pub"
|
|
}
|
|
|
|
variable "dns_record_name" {
|
|
description = "DNS record name (subdomain). Use '@' for root or 'beeta' for beeta.realms.pub"
|
|
type = string
|
|
default = "beeta"
|
|
}
|
|
|
|
# =============================================================================
|
|
# Backup Configuration
|
|
# =============================================================================
|
|
|
|
variable "enable_droplet_backups" {
|
|
description = "Enable automated droplet backups"
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
# =============================================================================
|
|
# Tags
|
|
# =============================================================================
|
|
|
|
variable "tags" {
|
|
description = "Additional tags to apply to resources"
|
|
type = list(string)
|
|
default = []
|
|
}
|
|
|
|
# =============================================================================
|
|
# Forgejo Registry Configuration
|
|
# =============================================================================
|
|
|
|
variable "forgejo_registry" {
|
|
description = "Forgejo container registry URL"
|
|
type = string
|
|
default = "qbit.realms.pub"
|
|
}
|
|
|
|
# =============================================================================
|
|
# SSL Certificate Configuration
|
|
# =============================================================================
|
|
|
|
variable "letsencrypt_email" {
|
|
description = "Email for Let's Encrypt certificate notifications"
|
|
type = string
|
|
}
|