main.tf (779B)
1 # Needs HCLOUD_TOKEN env variable set 2 provider "hcloud" {} 3 4 # ssh key data 5 data "hcloud_ssh_key" "ssh_key_yubi" { 6 fingerprint = "d6:67:da:6a:cc:73:24:14:d5:98:af:6d:41:91:92:4c" 7 } 8 data "hcloud_ssh_key" "ssh_key_int" { 9 fingerprint = "1e:ab:c9:e0:9d:b0:2a:93:5c:f6:d2:16:44:5b:2e:ad" 10 } 11 12 # The server itself 13 resource "hcloud_server" "vpn" { 14 name = "vpn.e1e0.net" 15 image = "debian-10" 16 server_type = "cx11" 17 location = "fsn1" 18 ssh_keys = ["${data.hcloud_ssh_key.ssh_key_yubi.id}", "${data.hcloud_ssh_key.ssh_key_int.id}"] 19 } 20 21 # reverse dns 22 resource "hcloud_rdns" "vpn" { 23 server_id = hcloud_server.vpn.id 24 ip_address = hcloud_server.vpn.ipv4_address 25 dns_ptr = "vpn.e1e0.net" 26 } 27 28 # Output server IP 29 output "server_ip_vpn" { 30 value = "${hcloud_server.vpn.ipv4_address}" 31 }