Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
95 lines (79 loc) · 3.56 KB
/
Copy pathvariables.tf
File metadata and controls
95 lines (79 loc) · 3.56 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
variable "authorized" {
description = "Your confirmation that you own the instances this user data runs on, or are authorized to monitor them: the same statement as the tick box on the EyalSec Machines page. Must be true."
type = bool
validation {
condition = var.authorized
error_message = "Set authorized = true to confirm you own these instances or are authorized to monitor them."
}
}
variable "api_key_command" {
description = "A shell command, run as root at first boot, that prints a full-access EyalSec API key, for example a read from your cloud's secret store. Recommended: the key then never appears in the user data. Set this, api_key or install_secret."
type = string
default = ""
}
variable "api_key" {
description = "A full-access EyalSec API key, embedded in the user data. Anything on the instance that can read its user data can read the key, so prefer api_key_command."
type = string
default = ""
sensitive = true
validation {
condition = var.api_key == "" || can(regex("^es2_[A-Za-z0-9_-]+$", var.api_key))
error_message = "api_key must be an EyalSec API key (it starts with es2_)."
}
}
variable "install_secret" {
description = "A one-time install secret for one machine. It works once and expires 10 minutes after it was issued, so it suits a single instance launched right away, not an image or a scaling group."
type = string
default = ""
sensitive = true
validation {
condition = var.install_secret == "" || can(regex("^[A-Za-z0-9_.-]+$", var.install_secret))
error_message = "install_secret contains characters an install secret does not have."
}
}
variable "install_user" {
description = "The user es-python is installed for. es-python installs into this user's home and runs as this user, so use the account your Python service runs under."
type = string
default = "root"
validation {
condition = can(regex("^[a-z_][a-z0-9_-]{0,31}$", var.install_user))
error_message = "install_user must be a Linux user name."
}
}
variable "create_user" {
description = "Create install_user (a regular account with a home directory) when it does not exist yet."
type = bool
default = false
}
variable "machine_name" {
description = "The machine name the instance reports under. Empty uses the instance's host name at first boot. Each instance needs its own name."
type = string
default = ""
validation {
condition = length(var.machine_name) <= 128 && can(regex("^[A-Za-z0-9_.:@-]*$", var.machine_name))
error_message = "machine_name may be up to 128 characters: letters, digits and . _ - : @"
}
}
variable "python_version" {
description = "The Python version: 3.9, 3.10, 3.11, 3.12, 3.13 or 3.14. Empty matches the instance's own python3."
type = string
default = ""
validation {
condition = contains(["", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"], var.python_version)
error_message = "python_version must be 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 or empty."
}
}
variable "eyalsec_url" {
description = "Your EyalSec address."
type = string
default = "https://eyalsec.com"
validation {
condition = can(regex("^https://[A-Za-z0-9.-]+(:[0-9]+)?/?$", var.eyalsec_url))
error_message = "eyalsec_url must be an https:// address."
}
}
variable "gzip" {
description = "Compress the rendered user data. Leave it on for AWS, Azure and Google Cloud; turn it off for a platform that cannot read gzip user data."
type = bool
default = true
}