homelab/terraform/cloud/server.tf

33 lines
630 B
Terraform
Raw Normal View History

2024-01-30 19:54:08 +00:00
data "hcloud_image" "arch" {
with_selector = "os-flavor=archlinux"
most_recent = true
with_status = ["available"]
}
resource "hcloud_server" "merlin" {
count = var.instances
name = "merlin"
image = data.hcloud_image.arch.id
server_type = "cx11"
location = var.location
ssh_keys = [hcloud_ssh_key.default.id]
firewall_ids = [
hcloud_firewall.prod.id,
hcloud_firewall.Gitea_SSH.id,
hcloud_firewall.torrent.id,
hcloud_firewall.mail.id,
hcloud_firewall.ssh.id,
]
labels = {
}
lifecycle {
ignore_changes = [
ssh_keys,
2024-02-03 08:53:40 +00:00
image,
2024-01-30 19:54:08 +00:00
]
}
}