-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
72 lines (60 loc) · 1.78 KB
/
variables.tf
File metadata and controls
72 lines (60 loc) · 1.78 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
variable "project_id" {
description = "GCP project ID"
type = string
}
variable "region" {
description = "GCP region"
type = string
default = "europe-west4" # Netherlands
}
variable "zone" {
description = "GCP zone"
type = string
default = "europe-west4-a"
}
variable "machine_type" {
description = "Instance type for Factorio server (e2-small, e2-medium, etc.)"
type = string
}
variable "server_name" {
description = "Name for the Factorio server in-game"
type = string
}
variable "server_description" {
description = "Description for the Factorio server"
type = string
default = "Build something special!"
}
variable "max_players" {
description = "Maximum number of players"
type = number
default = 6
}
variable "admin_users" {
description = "List of Factorio usernames who should have admin privileges"
type = list(string)
validation {
condition = alltrue([
for user in var.admin_users : can(regex("^[a-zA-Z0-9_-]+$", user))
])
error_message = "Admin usernames must contain only letters, numbers, underscores, and hyphens."
}
}
variable "autosave_interval" {
description = "Autosave interval in minutes (how often the server automatically saves)"
type = number
default = 30
validation {
condition = var.autosave_interval >= 1 && var.autosave_interval <= 60
error_message = "Autosave interval must be between 1 and 60 minutes."
}
}
variable "autosave_slots" {
description = "Number of autosave slots (server cycles through this many autosave files)"
type = number
default = 5
validation {
condition = var.autosave_slots >= 1 && var.autosave_slots <= 20
error_message = "Autosave slots must be between 1 and 20."
}
}