-
Notifications
You must be signed in to change notification settings - Fork 0
/
instances.tf
68 lines (59 loc) · 1.52 KB
/
instances.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
resource "hcloud_server" "bastion" {
name = "bastion"
server_type = "cpx11"
image = var.image
location = var.location
ssh_keys = [hcloud_ssh_key.main.id]
firewall_ids = [hcloud_firewall.ssh.id]
network {
network_id = hcloud_network.main.id
ip = "10.0.1.2"
}
user_data = file("bastion-cloud-init.yml")
}
resource "hcloud_server" "nat_instance" {
name = "nat-instance"
server_type = "cpx11"
image = var.image
location = var.location
ssh_keys = [hcloud_ssh_key.main.id]
network {
network_id = hcloud_network.main.id
ip = "10.0.1.10"
}
user_data = file("nat-cloud-init.yml")
}
resource "hcloud_server" "service_1" {
name = "service-1"
server_type = "cpx11"
image = var.image
location = var.location
ssh_keys = [hcloud_ssh_key.main.id]
firewall_ids = [hcloud_firewall.private.id]
user_data = file("private-cloud-init.yml")
public_net {
ipv4_enabled = false
ipv6_enabled = false
}
network {
network_id = hcloud_network.main.id
ip = "10.0.2.100"
}
}
resource "hcloud_server" "database" {
name = "database"
server_type = "ccx13"
image = "ubuntu-22.04"
location = var.location
ssh_keys = [hcloud_ssh_key.main.id]
firewall_ids = [hcloud_firewall.private.id]
user_data = file("private-cloud-init.yml")
public_net {
ipv4_enabled = false
ipv6_enabled = false
}
network {
network_id = hcloud_network.main.id
ip = "10.0.2.2"
}
}