aboutsummaryrefslogtreecommitdiff
blob: aabde19b1dca994bf18ea26d61a91c9489f6f0e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
terraform {
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = "1.36.1"
    }
  }
}

variable "hcloud_token" {
  sensitive = true
}

variable "ip_range" {
  default = "10.0.1.0/24"
}

resource "hcloud_ssh_key" "framework" {
  name       = "framework"
  public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILS2i5/x9r+cv2j2/SUZ2x2fgQeGnJP1I7PUHC0UdWN6 framework"
}

data "hcloud_image" "debian" {
  name = "debian-11"
}

resource "hcloud_server" "default" {
  name        = "photo"
  image       = data.hcloud_image.debian.name
  server_type = "cpx11"
  location    = "fsn1"
  ssh_keys    = [hcloud_ssh_key.framework.id]

  public_net {
    ipv4_enabled = true
    ipv4         = hcloud_primary_ip.primary_ip_1.id
  }
  delete_protection  = false
  rebuild_protection = false

  firewall_ids = [hcloud_firewall.default.id]
}

resource "hcloud_primary_ip" "primary_ip_1" {
  name          = "primary_ip_test"
  datacenter    = "fsn1-dc14"
  type          = "ipv4"
  assignee_type = "server"
  auto_delete   = true
}

resource "hcloud_firewall" "default" {
  name = "default"
}
Powered by cgit v1.2.3 (git 2.41.0)