-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
35 lines (31 loc) · 1.01 KB
/
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
27
28
29
30
31
32
33
34
35
resource "hcloud_server" "default" {
name = var.name
server_type = var.server_type
image = var.image
location = var.location
datacenter = var.datacenter
user_data = var.user_data
ssh_keys = var.ssh_keys
keep_disk = var.keep_disk
iso = var.iso
rescue = var.rescue
labels = var.labels
backups = var.backups
firewall_ids = var.firewall_ids
delete_protection = var.delete_protection
rebuild_protection = var.rebuild_protection
}
resource "hcloud_server_network" "default" {
count = var.create_server_network ? 1 : 0
server_id = hcloud_server.default.id
alias_ips = var.alias_ips
network_id = var.network_id
subnet_id = var.subnet_id
ip = var.ip
}
resource "hcloud_snapshot" "default" {
count = var.create_snapshot ? 1 : 0
server_id = hcloud_server.default.id
description = var.description
labels = hcloud_server.default.labels
}