chore: Restructured infra modules

This commit is contained in:
2026-07-10 20:54:22 +01:00
parent d0d1385bf4
commit a7cfcc33ce
19 changed files with 473 additions and 230 deletions
+13
View File
@@ -0,0 +1,13 @@
# Private network shared by dev and prod (see docs/architecture.md "network" group).
# vpn is intentionally not attached to this network - it sits outside it in the diagram.
resource "hcloud_network" "main" {
name = "server-network"
ip_range = var.ip_range
}
resource "hcloud_network_subnet" "main" {
network_id = hcloud_network.main.id
type = "cloud"
network_zone = var.network_zone
ip_range = var.subnet_ip_range
}
+9
View File
@@ -0,0 +1,9 @@
output "id" {
value = hcloud_network.main.id
}
# Exposed so dependents can depend_on the subnet existing, not just the network -
# attaching a server to a network fails if the network has no subnet yet.
output "subnet_id" {
value = hcloud_network_subnet.main.id
}
+14
View File
@@ -0,0 +1,14 @@
variable "ip_range" {
description = "IP range of the private network shared by dev and prod."
type = string
}
variable "network_zone" {
description = "Hetzner Cloud network zone matching var.location."
type = string
}
variable "subnet_ip_range" {
description = "IP range of the network subnet shared by dev and prod."
type = string
}