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-fra0" = {
|
|
|
|
region = "fra"
|
|
|
|
plan = "vhp-1c-1gb-amd"
|
|
|
|
}
|
|
|
|
"reisen-nrt0" = {
|
|
|
|
region = "nrt"
|
|
|
|
plan = "vhp-1c-1gb-amd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|