nixos-config/infra/vultr.tf

36 lines
775 B
Terraform
Raw Normal View History

2024-12-15 16:23:50 +08:00
provider "vultr" {
api_key = local.secrets.vultr.api_key
}
2024-12-15 18:29:58 +08:00
locals {
vultr_nodes = {
"reisen-sea0" = {
region = "sea"
plan = "vhp-1c-1gb-amd"
}
"reisen-nrt0" = {
region = "nrt"
plan = "vhp-1c-1gb-amd"
}
2024-12-17 22:08:23 +08:00
"reisen-sin0" = {
region = "sgp"
plan = "vhp-1c-1gb-amd"
}
2024-12-15 18:29:58 +08:00
}
}
2024-12-15 16:23:50 +08:00
resource "vultr_ssh_key" "marisa-7d76" {
name = "rebmit@marisa-7d76"
2024-12-15 18:29:58 +08:00
ssh_key = trim(file("${path.module}/../nixos/profiles/users/root/_ssh/marisa-7d76"), "\n ")
}
module "vultr_instances" {
source = "./modules/vultr-instance"
for_each = local.vultr_nodes
hostname = each.key
fqdn = "${each.key}.rebmit.link"
region = each.value.region
plan = each.value.plan
ssh_keys = [vultr_ssh_key.marisa-7d76.id]
2024-12-15 16:23:50 +08:00
}