Files
OpenTofuPlayground/variables.tf
Lutz Finsterle cb4d02a361
Some checks failed
Deploy / Update K8s Apps / Detect changed K8s tfvars (push) Successful in 12s
Deploy / Update Apps / Detect changed tfvars files (push) Successful in 11s
Test / Unit Tests — Docker Stack (push) Has been skipped
Test / Unit Tests — K8s Stack (push) Has been skipped
Test / Static Analysis (push) Failing after 23s
Deploy / Update K8s Apps / Deploy ${{ matrix.tfvars }} (push) Failing after 12s
Deploy / Update K8s Apps / Destroy ${{ matrix.tfvars }} (push) Has been skipped
Deploy / Update Apps / Deploy ${{ matrix.tfvars }} (push) Failing after 12s
Deploy / Update Apps / Destroy ${{ matrix.tfvars }} (push) Has been skipped
Test / Integration Test — K8s (k3d) (push) Has been skipped
tofu fmt
2026-03-13 20:13:42 +01:00

128 lines
4.1 KiB
HCL

# ─── Remote Host (SSH) ────────────────────────────────────────────────────────
variable "ssh_host" {
description = "Hostname or IP of the remote Docker host."
type = string
}
variable "ssh_user" {
description = "SSH user on the remote Docker host."
type = string
}
variable "ssh_key_path" {
description = "Absolute path to the SSH private key file used to connect to the remote host."
type = string
}
# ─── App Identity ─────────────────────────────────────────────────────────────
variable "app_name" {
description = "Unique name for this app deployment. Used as prefix for all resource names."
type = string
}
variable "environment" {
description = "Deployment environment: 'prod' (persistent volumes) or 'dev' (ephemeral)."
type = string
default = "dev"
}
# ─── OpenResty ────────────────────────────────────────────────────────────────
variable "openresty_source_type" {
description = "OpenResty config source: 'bind_mount', 'local_build', or 'git_clone'."
type = string
}
variable "openresty_image" {
description = "Base OpenResty Docker image (bind_mount and git_clone modes)."
type = string
default = "openresty/openresty:1.25.3-alpine"
}
variable "openresty_external_port" {
description = "External port on the remote host that maps to OpenResty port 80."
type = number
}
# bind_mount
variable "openresty_remote_config_path" {
description = "Path on the REMOTE HOST to mount as OpenResty config dir (bind_mount mode)."
type = string
default = ""
}
# local_build
variable "openresty_local_build_context" {
description = "Local path to Dockerfile build context directory (local_build mode)."
type = string
default = ""
}
variable "openresty_dockerfile" {
description = "Dockerfile filename within the build context (local_build mode)."
type = string
default = "Dockerfile"
}
# git_clone
variable "openresty_git_repo" {
description = "Git repository URL to clone at container startup (git_clone mode)."
type = string
default = ""
}
variable "openresty_git_ref" {
description = "Git ref (tag, branch, commit SHA) to checkout (git_clone mode). Must be a pinned tag or SHA, not a branch name."
type = string
default = ""
validation {
condition = var.openresty_git_ref == "" || !contains(
["main", "master", "develop", "dev", "staging", "HEAD", "latest", "trunk"],
var.openresty_git_ref
)
error_message = "openresty_git_ref must be a pinned tag or commit SHA, not a mutable branch name. Got: '${var.openresty_git_ref}'."
}
}
variable "openresty_git_token" {
description = "Optional auth token for private git repos (git_clone mode)."
type = string
default = ""
sensitive = true
}
# ─── PostgreSQL ───────────────────────────────────────────────────────────────
variable "db_name" {
description = "PostgreSQL database name."
type = string
}
variable "db_user" {
description = "PostgreSQL user."
type = string
}
variable "db_password" {
description = "PostgreSQL password."
type = string
sensitive = true
}
variable "postgres_image" {
description = "PostgreSQL Docker image."
type = string
default = "postgres:16-alpine"
}
# ─── Redis ────────────────────────────────────────────────────────────────────
variable "redis_image" {
description = "Redis Docker image."
type = string
default = "redis:7-alpine"
}