Files
heygo/terraform/variables.tf
T
Hermes Agent e4fbbaec14 feat: add terraform IaC, dev/prod environments, and multi-host worker support
- Terraform configs for D1 databases, KV namespaces, Worker custom domains
- wrangler.dev.jsonc and wrangler.prod.jsonc for environment-specific deployments
- Worker code refactored to use env vars for host checking (PUBLIC_HOST, PRIVATE_HOST)
- Configurable app URLs and cookie domain via env vars
- Deploy and migrate npm scripts for dev/prod
- Updated all tests with new env fixtures
- Deployment guide in README
2026-06-20 14:26:56 +10:00

68 lines
2.2 KiB
Terraform

variable "cloudflare_api_token" {
type = string
sensitive = true
description = "Cloudflare API token with D1, Workers KV, and Workers Custom Domains permissions. Export via the CLOUDFLARE_API_TOKEN env var instead of committing it."
}
variable "account_id" {
type = string
description = "Cloudflare account ID that owns the D1 databases, KV namespaces, and Workers."
}
variable "environment" {
type = string
description = "Deployment environment. Must be \"dev\" or \"prod\"."
validation {
condition = var.environment == "dev" || var.environment == "prod"
error_message = "environment must be either \"dev\" or \"prod\"."
}
}
variable "heygo_cc_zone_id" {
type = string
description = "Cloudflare zone ID for heygo.cc. The public shortlinks hostname always lives under this zone."
}
variable "private_domain_zone_id" {
type = string
description = "Zone ID where the private shortlinks hostname lives. For prod this is the same as heygo_cc_zone_id (my.heygo.cc is under heygo.cc); for dev it is the junv.cc zone ID (my.dev.junv.cc)."
}
variable "public_domain" {
type = string
description = "Public shortlinks hostname (e.g. heygo.cc or dev.heygo.cc)."
}
variable "private_domain" {
type = string
description = "Private shortlinks hostname (e.g. my.heygo.cc or my.dev.junv.cc)."
}
variable "d1_database_name" {
type = string
description = "Name of the D1 database that stores short links and sessions."
}
variable "kv_namespace_title" {
type = string
description = "Title of the Workers KV namespace used for public link caching."
}
variable "worker_name" {
type = string
description = "Name of the Cloudflare Worker service that the custom domains route to."
}
variable "primary_location_hint" {
type = string
default = "wnam"
description = "Region hint for the D1 primary. One of wnam, enam, weur, eeur, apac, oc."
validation {
condition = contains(
["wnam", "enam", "weur", "eeur", "apac", "oc"],
var.primary_location_hint,
)
error_message = "primary_location_hint must be one of wnam, enam, weur, eeur, apac, oc."
}
}