-
Notifications
You must be signed in to change notification settings - Fork 14
/
variables.tf
58 lines (53 loc) · 1.67 KB
/
variables.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
# Required configuration
variable "ssh_public_key" {
type = string
description = "SSH Public Key"
}
# Optional configuration
variable "server" {
type = map(any)
description = "Server configuration map"
default = {
name = "docker-host"
server_type = "cx11"
image = "ubuntu-22.04"
location = "nbg1"
backups = false
}
}
variable "docker_compose_version" {
type = string
description = "Docker compose version to install"
default = "2.17.3" # https://github.com/docker/compose/releases/latest
}
variable "volume_size" {
type = number
description = "Volume size (GB) (min 10, max 10240)"
default = 10 # https://docs.hetzner.cloud/#volumes-create-a-volume
validation {
condition = ceil(var.volume_size) == var.volume_size
error_message = "Volume size must be a whole number between 10 and 10240."
}
validation {
condition = var.volume_size >= 10
error_message = "Volume size value too small. The minimum volume size is 10 (10GB)."
}
validation {
condition = var.volume_size <= 10240
error_message = "Volume size value too large. The maximum volume size is 10240 (10TB)."
}
}
variable "volume_filesystem" {
type = string
description = "Volume filesystem"
default = "xfs" # https://docs.hetzner.cloud/#volumes-create-a-volume
validation {
condition = length(regexall("^ext4|xfs$", var.volume_filesystem)) > 0
error_message = "Invalid volume filesystem type value. Valid filesystem types are ext4 or xfs."
}
}
variable "ssh_public_key_name" {
type = string
description = "SSH Public Key Name"
default = "default"
}