-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
63 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
59
60
61
62
63
# ====================================
# Manage SSH keys in the Hetzner Cloud
# ====================================
# ---------------
# Input Variables
# ---------------
variable "ssh_keys" {
description = "The list of SSH key objects to be managed. Each key object supports the following parameters: 'name' (string, required), 'algorithm' (string, optional), 'key_param' (string, optional), 'public_key' (string, optional), 'labels' (map of KV pairs, optional)."
type = list(
object({
name = string
algorithm = string
key_param = string
public_key = string
labels = map(string)
})
)
default = [
{
name = "ssh-key-1"
algorithm = null
key_param = null
public_key = "~/.ssh/id_rsa.pub"
labels = {}
}
]
validation {
condition = can([
for ssh_key in var.ssh_keys : regex("\\w+", ssh_key.name)
])
error_message = "All SSH keys must have a valid 'name' attribute specified."
}
}
variable "ssh_key_path" {
description = "The destination path for generated SSH key files. Defaults to '~/.ssh'."
type = string
default = "~/.ssh"
}
variable "ssh_key_path_perms" {
description = "The permissions for the SSH key destination path. Defaults to '0700'."
type = string
default = "0700"
}
variable "ssh_private_key_perms" {
description = "The permissions for generated SSH private key files. Defaults to '0600'."
type = string
default = "0600"
}
variable "ssh_public_key_perms" {
description = "The permissions for generated SSH public key files. Defaults to '0640'."
type = string
default = "0640"
}