- This commit introduces the Terraform configuration to provision a production environment on Hetzner Cloud, building on the existing test setup. - Key improvements and new features include: * **Multi-node clusters:** Scaling to 3-node Swarm application and database clusters for improved resilience. * **High availability:** Utilizing a Hetzner Floating IP for the application entry point and `spread` placement groups for fault tolerance across physical hosts. * **Enhanced network security:** Internal management services (RabbitMQ, APISIX, Prometheus, Grafana) are restricted to the application subnet, expected to be accessed via an internal reverse proxy (SWAG). * **Internal database replication:** New firewall rules enable PostgreSQL replication and MongoDB replica set traffic within the database subnet. * **Refined test environment:** Updates to align `test` configuration with the new `prod` structure, including a dedicated floating IP and adjusted firewall rules. * **Configuration standardization:** Environment-specific details moved to `locals.tf` for clarity, with upgraded server types and migration to Rocky Linux as the base image. - Updates were also made to the latest version of Terraform to ensure consistency in the documentation
41 lines
920 B
HCL
41 lines
920 B
HCL
variable "hcloud_token" {
|
|
type = string
|
|
sensitive = true
|
|
description = "Hetzner Cloud API token for the test project"
|
|
}
|
|
|
|
variable "location" {
|
|
type = string
|
|
default = "fsn1"
|
|
description = "Hetzner Cloud datacenter location"
|
|
}
|
|
|
|
variable "image" {
|
|
type = string
|
|
default = "rocky-10"
|
|
description = "Server image"
|
|
}
|
|
|
|
variable "server_type_swarm" {
|
|
type = string
|
|
default = "cx32"
|
|
description = "Hetzner server type for the Swarm node"
|
|
}
|
|
|
|
variable "server_type_db" {
|
|
type = string
|
|
default = "cx42"
|
|
description = "Hetzner server type for the DB node"
|
|
}
|
|
|
|
variable "admin_ssh_public_key_path" {
|
|
type = string
|
|
default = "~/.ssh/id_ed25519.pub"
|
|
description = "Path to the admin SSH public key file"
|
|
}
|
|
|
|
variable "admin_allowed_cidrs" {
|
|
type = list(string)
|
|
description = "CIDR list for admin SSH and management port access"
|
|
}
|