-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
282 lines (239 loc) · 7.54 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
variable "cluster_name" {
type = string
description = "Cluster prefix for all resources"
validation {
condition = length(var.cluster_name) <= 37
error_message = "The cluster name maximum allowed length is 37."
}
}
variable "project_id" {
type = string
description = "Project id"
}
variable "nics_numbers" {
type = number
description = "Number of nics per host"
default = -1
validation {
condition = var.nics_numbers == -1 || var.nics_numbers > 0
error_message = "The nics_number value can take values > 0 or -1 (for using defaults)."
}
}
variable "prefix" {
type = string
description = "Prefix for all resources"
default = "weka"
validation {
condition = length(var.prefix) <= 15
error_message = "The prefix maximum allowed length is 15."
}
}
variable "zone" {
type = string
description = "Zone name"
}
variable "machine_type" {
type = string
description = "Weka cluster backends machines type"
default = "c2-standard-8"
validation {
condition = contains(["c2-standard-8", "c2-standard-16"], var.machine_type)
error_message = "Machine type isn't supported"
}
}
variable "region" {
type = string
description = "Region name"
}
variable "nvmes_number" {
type = number
description = "Number of local nvmes per host"
default = 2
}
variable "assign_public_ip" {
type = string
default = "auto"
description = "Determines whether to assign public IP to all instances deployed by TF module. Includes backends, clients and protocol gateways."
validation {
condition = var.assign_public_ip == "true" || var.assign_public_ip == "false" || var.assign_public_ip == "auto"
error_message = "Allowed assign_public_ip values: [\"true\", \"false\", \"auto\"]."
}
}
variable "get_weka_io_token" {
type = string
description = "Get get.weka.io token for downloading weka"
sensitive = true
default = ""
}
variable "install_weka_url" {
type = string
description = "Path to weka installation tar object"
default = ""
}
variable "weka_version" {
type = string
description = "Weka version"
default = "4.2.11"
}
variable "weka_username" {
type = string
description = "Weka cluster username"
default = "admin"
}
variable "cluster_size" {
type = number
description = "Weka cluster size"
validation {
condition = var.cluster_size >= 6
error_message = "Cluster size should be at least 6."
}
default = 6
}
variable "vpc_connector_range" {
type = string
description = "list of connector to use for serverless vpc access"
default = "10.8.0.0/28"
}
variable "vpc_connector_id" {
type = string
description = "exiting vpc connector id to use for cloud functions, projects/<project-id>/locations/<region>/connectors/<connector-name>"
default = ""
}
variable "sa_email" {
type = string
description = "Service account email"
default = ""
}
variable "create_cloudscheduler_sa" {
type = bool
description = "Create GCP cloudscheduler sa"
default = true
}
variable "yum_repo_server" {
type = string
description = "Yum repo server address"
default = ""
}
variable "allow_ssh_cidrs" {
type = list(string)
description = "Allow port 22, if not provided, i.e leaving the default empty list, the rule will not be included in the SG"
default = []
}
variable "allow_weka_api_cidrs" {
type = list(string)
description = "allow connection to port 14000 on weka backends and LB(if exists and not provided with dedicated SG) from specified CIDRs, by default no CIDRs are allowed. All ports (including 14000) are allowed within VPC"
default = []
}
variable "source_image_id" {
type = string
description = "Source image for deployment (default: rocky-linux-8-v20240515). While other distributions may be compatible, only Rocky Linux 8 is officially tested with this Terraform module."
default = "rocky-linux-8-v20240515"
}
variable "protection_level" {
type = number
default = 2
description = "Cluster data protection level."
validation {
condition = var.protection_level == 2 || var.protection_level == 4
error_message = "Allowed protection_level values: [2, 4]."
}
}
variable "stripe_width" {
type = number
default = -1
description = "Stripe width = cluster_size - protection_level - 1 (by default)."
validation {
condition = var.stripe_width == -1 || var.stripe_width >= 3 && var.stripe_width <= 16
error_message = "The stripe_width value can take values from 3 to 16."
}
}
variable "hotspare" {
type = number
default = 1
description = "Hot-spare value."
}
variable "default_disk_size" {
type = number
default = 48
description = "The default disk size."
}
variable "default_disk_name" {
type = string
default = "wekaio-volume"
description = "The default disk name."
}
variable "traces_per_ionode" {
default = 10
type = number
description = "The number of traces per ionode. Traces are low-level events generated by Weka processes and are used as troubleshooting information for support purposes."
}
variable "tiering_obs_name" {
type = string
default = ""
description = "Name of OBS cloud storage"
}
variable "tiering_enable_obs_integration" {
type = bool
default = false
description = "Determines whether to enable object stores integration with the Weka cluster. Set true to enable the integration."
}
variable "tiering_ssd_percent" {
type = number
default = 20
description = "When OBS integration set to true , this parameter sets how much of the filesystem capacity should reside on SSD. For example, if this parameter is 20 and the total available SSD capacity is 20GB, the total capacity would be 100GB"
}
variable "set_dedicated_fe_container" {
type = bool
default = true
description = "Create cluster with FE containers"
}
variable "state_bucket_name" {
type = string
default = ""
description = "Name of bucket state, cloud storage"
}
variable "proxy_url" {
type = string
description = "Weka home proxy url"
default = ""
}
variable "create_worker_pool" {
type = bool
default = false
description = "Create worker pool"
}
######################## From multivpc variables ##########################
variable "network_names" {
description = "Names of the new VPC networks"
type = list(string)
validation {
condition = length(var.network_names) == 4 || length(var.network_names) == 7
error_message = "The allowed amount of networks are 4 and 7"
}
}
variable "subnetwork_names" {
description = "Names of the subnetwork created in each network"
type = list(string)
validation {
condition = length(var.subnetwork_names) == 4 || length(var.subnetwork_names) == 7
error_message = "The allowed amount of subnets are 4 and 7"
}
}
variable "network_self_links" {
description = "Self link of the VPC networks"
type = list(string)
validation {
condition = length(var.network_self_links) == 4 || length(var.network_self_links) == 7
error_message = "The allowed amount of networks are 4 and 7"
}
}
variable "local_mount" {
description = "Mountpoint for this WEKAFS on client systems"
type = string
default = "/data"
validation {
condition = alltrue([substr(var.local_mount, 0, 1) == "/"
])
error_message = "Local mountpoints have to start with '/'."
}
}