23 lines
584 B
HCL
23 lines
584 B
HCL
// Add the servers to a placement group.
|
|
resource "hcloud_placement_group" "group" {
|
|
name = "Cluster Group"
|
|
type = "spread"
|
|
}
|
|
|
|
// Secure NAT via SSH key.
|
|
resource "hcloud_ssh_key" "main" {
|
|
name = "my-ssh-key"
|
|
public_key = file(var.public_key_file)
|
|
}
|
|
|
|
// The Jumphost/NAT, to interact and provide internet access to the cluster.
|
|
resource "hcloud_server" "nat" {
|
|
name = "Cluster NAT"
|
|
image = "debian-12"
|
|
server_type = "cx23"
|
|
placement_group_id = hcloud_placement_group.group.id
|
|
ssh_keys = [hcloud_ssh_key.main.id]
|
|
}
|
|
|
|
|