dotfiles/terranix/altra.nix
Magic_RB 558f2b656c
Add altra terraform code
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2023-06-22 23:25:39 +02:00

54 lines
1.2 KiB
Nix

{ tflib, lib, ... }:
let
inherit (lib)
singleton;
inherit (tflib)
tf;
in
{
terraform.required_providers = {
hcloud.source = "hetznercloud/hcloud";
};
resource."hcloud_primary_ip"."altra_ipv4" = {
name = "altra_ipv4";
datacenter = "fsn1-dc14";
type = "ipv4";
assignee_type = "server";
auto_delete = false;
delete_protection = true;
};
resource."hcloud_primary_ip"."altra_ipv6" = {
name = "altra_ipv6";
datacenter = "fsn1-dc14";
type = "ipv6";
assignee_type = "server";
auto_delete = false;
delete_protection = true;
};
resource."hcloud_ssh_key"."magic_rb" = {
name = "magic_rb";
public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFVkFvalffJ/SMjJGG3WPiqCqFygnWzhGUaeALBIoCsJ (none)";
};
resource."hcloud_server"."altra" = {
name = "altra";
image = "debian-12";
datacenter = "fsn1-dc14";
server_type = "cax11";
public_net = {
ipv4_enabled = true;
ipv4 = tf "hcloud_primary_ip.altra_ipv4.id";
ipv6_enabled = false;
ipv6 = tf "hcloud_primary_ip.altra_ipv6.id";
};
delete_protection = true;
rebuild_protection = true;
ssh_keys = singleton (tf "hcloud_ssh_key.magic_rb.id");
};
}