-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
26 lines (24 loc) · 785 Bytes
/
main.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
resource "hcloud_network" "automation_net" {
name = "Automation_NET"
ip_range = "10.10.0.0/24"
}
resource "hcloud_network_subnet" "create_subnet" {
network_id = hcloud_network.automation_net.id
type = "cloud"
network_zone = "eu-central"
ip_range = "10.10.0.0/24"
}
resource "hcloud_server" "elastic_master" {
count = 3
name = "master-vm-${count.index + 1}"
image = var.image
server_type = var.server_type
location = var.location
ssh_keys = ["${data.hcloud_ssh_key.ssh_key.id}"]
}
resource "hcloud_server_network" "attach_to_network" {
count = 3
server_id = hcloud_server.elastic_master[count.index].id
network_id = hcloud_network.automation_net.id
ip = "10.10.0.${110 + count.index + 1}"
}