-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.tf
73 lines (60 loc) · 1.65 KB
/
matrix.tf
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Matrix Server
resource "hcloud_server" "matrix" {
name = "matrix"
image = "ubuntu-22.04"
server_type = "ccx22"
location = "ash"
ssh_keys = [
hcloud_ssh_key.tatooine_ssh_key.id,
hcloud_ssh_key.coruscant_ssh_key.id,
hcloud_ssh_key.scarif_ssh_key.id,
]
firewall_ids = [
hcloud_firewall.web_server_firewall.id,
]
public_net {
ipv4_enabled = true
ipv6_enabled = true
}
user_data = file("./cloud-init/nixos")
}
output "matrix_server_ipv4" {
value = hcloud_server.matrix.ipv4_address
}
output "matrix_server_ipv6" {
value = hcloud_server.matrix.ipv6_address
}
resource "hcloud_volume" "matrix-postgres-data" {
name = "matrix-postgres-data"
size = 150
location = "ash"
format = "ext4"
}
output "matrix_server_postgresql_data_linux_device" {
value = hcloud_volume.matrix-postgres-data.linux_device
}
resource "hcloud_volume_attachment" "main" {
volume_id = hcloud_volume.matrix-postgres-data.id
server_id = hcloud_server.matrix.id
automount = true
}
resource "hcloud_server_network" "matrix_nevarronet" {
server_id = hcloud_server.matrix.id
network_id = hcloud_network.nevarro_network.id
ip = "10.0.1.3"
}
output "matrix_server_internal_ip" {
value = hcloud_server_network.matrix_nevarronet.ip
}
resource "hetznerdns_record" "nevarro_space_a_matrix" {
zone_id = hetznerdns_zone.nevarro_space.id
name = "matrix"
value = hcloud_server.matrix.ipv4_address
type = "A"
}
resource "hetznerdns_record" "nevarro_space_a_meetbot" {
zone_id = hetznerdns_zone.nevarro_space.id
name = "meetbot"
value = hcloud_server.matrix.ipv4_address
type = "A"
}