This commit introduces the foundational Infrastructure-as-Code for provisioning a test environment on Hetzner Cloud. It defines server nodes, private networking, comprehensive firewalls, and includes documentation on resource lifecycle and safe configuration practices.
23 lines
515 B
HCL
23 lines
515 B
HCL
resource "hcloud_network" "main" {
|
|
name = "${local.name_prefix}-net"
|
|
ip_range = local.network_cidr
|
|
|
|
labels = {
|
|
environment = var.environment
|
|
}
|
|
}
|
|
|
|
resource "hcloud_network_subnet" "app" {
|
|
network_id = hcloud_network.main.id
|
|
type = "cloud"
|
|
network_zone = "eu-central"
|
|
ip_range = local.app_subnet_cidr
|
|
}
|
|
|
|
resource "hcloud_network_subnet" "db" {
|
|
network_id = hcloud_network.main.id
|
|
type = "cloud"
|
|
network_zone = "eu-central"
|
|
ip_range = local.db_subnet_cidr
|
|
}
|