-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.tf
executable file
·372 lines (319 loc) · 10.4 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
variable "teamid" {
description = "(Required) Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
type = string
}
variable "prjid" {
description = "(Required) Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
type = string
}
# ------------------------------------------------
# Cluster Instance Pool
# ------------------------------------------------
variable "min_idle_instances" {
description = "instance pool minimum idle instances"
type = number
default = 1
}
variable "max_capacity" {
description = "instance pool maximum capacity"
type = number
default = 3
}
variable "idle_instance_autotermination_minutes" {
description = "idle instance auto termination duration"
type = number
default = 20
}
# ------------------------------------------------
# Cluster
# ------------------------------------------------
variable "deploy_cluster" {
description = "feature flag, true or false"
default = false
type = bool
}
variable "deploy_job_cluster" {
description = "feature flag, true or false"
default = false
type = bool
}
variable "cluster_autotermination_minutes" {
description = "cluster auto termination duration"
type = number
default = 30
}
variable "deploy_cluster_policy" {
description = "feature flag, true or false"
default = false
type = bool
}
variable "cluster_policy_id" {
description = "Exiting cluster policy id"
type = string
default = null
}
variable "policy_overrides" {
description = "Cluster policy overrides"
type = any
default = null
}
variable "auto_scaling" {
description = "Number of min and max workers in auto scale."
type = list(any)
default = null
}
variable "fixed_value" {
description = "Number of nodes in the cluster."
type = number
default = 0
}
variable "aws_attributes" {
description = "Optional configuration block contains attributes related to clusters running on AWS."
type = any
default = null
}
variable "azure_attributes" {
description = "Optional configuration block contains attributes related to clusters running on Azure."
type = any
default = null
}
variable "gcp_attributes" {
description = "Optional configuration block contains attributes related to clusters running on GCP."
type = any
default = null
}
variable "spark_env_vars" {
description = "Map with environment variable key-value pairs to fine-tune Spark clusters. Key-value pairs of the form (X,Y) are exported (i.e., X='Y') while launching the driver and workers."
type = any
default = null
}
variable "spark_conf" {
description = "Map with key-value pairs to fine-tune Spark clusters, where you can provide custom Spark configuration properties in a cluster configuration."
type = any
default = null
}
variable "add_instance_profile_to_workspace" {
description = "Existing AWS instance profile ARN"
type = bool
default = false
}
# ------------------------------------------------
# Job
# ------------------------------------------------
variable "deploy_jobs" {
description = "feature flag, true or false"
default = false
type = bool
}
variable "email_notifications" {
description = "Email notification block."
type = any
default = null
}
variable "schedule" {
description = "Job schedule configuration."
type = map(any)
default = null
}
variable "task_parameters" {
description = "Base parameters to be used for each run of this job."
type = map(any)
default = {}
}
variable "retry_on_timeout" {
description = "An optional policy to specify whether to retry a job when it times out. The default behavior is to not retry on timeout."
type = bool
default = false
}
variable "max_retries" {
description = " An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with a FAILED result_state or INTERNAL_ERROR life_cycle_state. The value -1 means to retry indefinitely and the value 0 means to never retry. The default behavior is to never retry."
type = number
default = 0
}
variable "timeout" {
description = "An optional timeout applied to each run of this job. The default behavior is to have no timeout."
default = null
type = number
}
variable "min_retry_interval_millis" {
description = "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried."
default = null
type = number
}
variable "max_concurrent_runs" {
description = "An optional maximum allowed number of concurrent runs of the job."
default = null
type = number
}
variable "always_running" {
description = "Whenever the job is always running, like a Spark Streaming application, on every update restart the current active run or start it again, if nothing it is not running. False by default."
default = false
type = bool
}
# ------------------------------------------------
# Notebook
# ------------------------------------------------
variable "local_notebooks" {
description = "Local path to the notebook(s) that will be used by the job"
type = any
default = []
}
variable "remote_notebooks" {
description = "Path to notebook(s) in the databricks workspace that will be used by the job"
type = any
default = []
}
variable "notebooks" {
description = "Local path to the notebook(s) that will be deployed"
type = any
default = []
}
# ------------------------------------------------
# Cluster Node type
# ------------------------------------------------
variable "local_disk" {
description = "Pick only nodes with local storage. Defaults to false."
type = string
default = true
}
variable "min_cores" {
description = "Minimum number of CPU cores available on instance. Defaults to 0."
type = string
default = 0
}
variable "gb_per_core" {
description = "Number of gigabytes per core available on instance. Conflicts with min_memory_gb. Defaults to 0."
type = string
default = 0
}
variable "min_gpus" {
description = "Minimum number of GPU's attached to instance. Defaults to 0."
type = string
default = 0
}
variable "min_memory_gb" {
description = "Minimum amount of memory per node in gigabytes. Defaults to 0."
type = string
default = 0
}
variable "category" {
description = "Node category, which can be one of: General purpose, Memory optimized, Storage optimized, Compute optimized, GPU"
type = string
default = "General purpose"
}
variable "cluster_id" {
description = "Existing cluster id"
type = string
default = null
}
variable "worker_node_type_id" {
description = "The node type of the Spark worker."
type = string
default = null
}
variable "deploy_worker_instance_pool" {
description = "Worker instance pool"
type = bool
default = false
}
variable "deploy_driver_instance_pool" {
description = "Driver instance pool"
type = bool
default = false
}
# ------------------------------------------------
# Spark version
# ------------------------------------------------
variable "gpu" {
description = "GPU required or not."
type = bool
default = false
}
variable "ml" {
description = "ML required or not."
type = bool
default = false
}
variable "spark_version" {
description = "Runtime version of the cluster. Any supported databricks_spark_version id. We advise using Cluster Policies to restrict the list of versions for simplicity while maintaining enough control."
type = string
default = null
}
# ------------------------------------------------
# Databricks admin console
# ------------------------------------------------
variable "create_user" {
description = "Create a new user, if user already exists the deployment will fail."
type = bool
default = false
}
variable "create_group" {
description = "Create a new group, if group already exists the deployment will fail."
type = bool
default = false
}
variable "databricks_username" {
description = "User allowed to access the platform."
type = string
default = ""
}
variable "driver_node_type_id" {
description = "The node type of the Spark driver. This field is optional; if unset, API will set the driver node type to the same value as node_type_id."
type = string
default = null
}
variable "allow_cluster_create" {
description = " This is a field to allow the group to have cluster create privileges. More fine grained permissions could be assigned with databricks_permissions and cluster_id argument. Everyone without allow_cluster_create argument set, but with permission to use Cluster Policy would be able to create clusters, but within boundaries of that specific policy."
type = bool
default = true
}
variable "allow_instance_pool_create" {
description = "This is a field to allow the group to have instance pool create privileges. More fine grained permissions could be assigned with databricks_permissions and instance_pool_id argument."
type = bool
default = true
}
variable "cluster_access_control" {
type = any
description = "Cluster access control"
default = null
}
variable "instance_pool_access_control" {
type = any
description = "Instance pool access control"
default = null
}
variable "policy_access_control" {
type = any
description = "Policy access control"
default = null
}
variable "jobs_access_control" {
type = any
description = "Jobs access control"
default = null
}
variable "notebooks_access_control" {
type = any
description = "Notebook access control"
default = null
}
variable "cluster_name" {
type = string
description = "Cluster name"
default = null
}
variable "custom_tags" {
type = any
description = "Extra custom tags"
default = null
}
variable "libraries" {
type = map(any)
description = "Installs a library on databricks_cluster"
default = {}
}
variable "data_security_mode" {
description = "Access mode"
type = string
default = "NONE"
}