flake/infra/vultr.tf

33 lines
696 B
Terraform
Raw Normal View History

2024-09-21 16:21:30 +00:00
locals {
nodes = {
sin0 = {
region = "sgp"
plan = "vhp-1c-1gb-amd"
2024-09-21 20:19:03 +00:00
tags = ["vultr", "proxy"]
2024-09-21 16:21:30 +00:00
}
}
}
resource "vultr_startup_script" "script" {
name = "nixos"
type = "pxe"
script = base64encode(<<EOT
#!ipxe
set cmdline sshkey="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMmd/uqiBahzKcKMJ+gT3dkUIdrWQgudspsDchDlx1E/"
chain https://github.com/NickCao/netboot/releases/download/latest/ipxe
EOT
)
}
module "vultr" {
source = "./modules/vultr"
for_each = local.nodes
hostname = each.key
fqdn = "${each.key}.ny4.dev"
region = each.value.region
plan = each.value.plan
tags = each.value.tags
script = vultr_startup_script.script.id
}