terraform
This commit is contained in:
commit
33a12b643f
15 changed files with 1021 additions and 0 deletions
73
terraform/servers.tf
Normal file
73
terraform/servers.tf
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# Ops Server - CX22 (2 vCPU, 4GB RAM)
|
||||
resource "hcloud_server" "ops" {
|
||||
name = "asxpio-ops"
|
||||
image = "debian-13"
|
||||
location = "hel1"
|
||||
server_type = "cx23"
|
||||
|
||||
ssh_keys = [
|
||||
hcloud_ssh_key.asxpi.id,
|
||||
hcloud_ssh_key.deploy.id
|
||||
]
|
||||
|
||||
backups = false
|
||||
|
||||
public_net {
|
||||
ipv4_enabled = true
|
||||
ipv6_enabled = true
|
||||
}
|
||||
|
||||
network {
|
||||
network_id = hcloud_network.main.id
|
||||
ip = "10.10.0.10"
|
||||
}
|
||||
|
||||
firewall_ids = [hcloud_firewall.ops_fw.id]
|
||||
|
||||
labels = {
|
||||
role = "ops"
|
||||
env = "production"
|
||||
managed_by = "terraform"
|
||||
project = "asxpio"
|
||||
}
|
||||
|
||||
# Cloud-init for automated server setup
|
||||
user_data = file("${path.module}/cloud-init/ops.yaml")
|
||||
}
|
||||
|
||||
# Services Server - CX43 (8 vCPU, 16GB RAM)
|
||||
resource "hcloud_server" "services" {
|
||||
name = "asxpio-services"
|
||||
image = "debian-13"
|
||||
location = "hel1"
|
||||
server_type = "cx43"
|
||||
|
||||
ssh_keys = [
|
||||
hcloud_ssh_key.asxpi.id,
|
||||
hcloud_ssh_key.deploy.id
|
||||
]
|
||||
|
||||
backups = false
|
||||
|
||||
public_net {
|
||||
ipv4_enabled = true
|
||||
ipv6_enabled = true
|
||||
}
|
||||
|
||||
network {
|
||||
network_id = hcloud_network.main.id
|
||||
ip = "10.10.0.20"
|
||||
}
|
||||
|
||||
firewall_ids = [hcloud_firewall.services_fw.id]
|
||||
|
||||
labels = {
|
||||
role = "services"
|
||||
env = "production"
|
||||
managed_by = "terraform"
|
||||
project = "asxpio"
|
||||
}
|
||||
|
||||
# Cloud-init for automated server setup
|
||||
user_data = file("${path.module}/cloud-init/services.yaml")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue