archlinux.tf 643 Bytes
Newer Older
1
2
3
4
terraform {
  backend "pg" {}
}

5
6
7
data "external" "hetzner_cloud_api_key" {
  program = ["bash", "${path.module}/misc/get_hetzner_cloud_api_key_terraform.sh"]
}
8
9
10
11
12
13
14

# Find the id using `hcloud image list`
variable "archlinux_image_id" {
  default = "2923545"
}

provider "hcloud" {
15
  token = "${data.external.hetzner_cloud_api_key.result.hetzner_cloud_api_key}"
16
17
18
}

resource "hcloud_rdns" "bbs" {
19
20
  server_id = "${hcloud_server.bbs.id}"
  ip_address = "${hcloud_server.bbs.ipv4_address}"
21
22
23
24
25
26
27
28
  dns_ptr = "bbs.archlinux.org"
}

resource "hcloud_server" "bbs" {
  name = "bbs.archlinux.org"
  image = "${var.archlinux_image_id}"
  server_type = "cx11"
}