Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
105 lines (87 loc) · 3.32 KB
/
Copy pathvariables.tf
File metadata and controls
105 lines (87 loc) · 3.32 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
96
97
98
99
100
101
102
103
104
105
variable "name" {
description = "Instance pool name."
type = string
nullable = false
validation {
condition = try(length(trimspace(var.name)) > 0, false)
error_message = "name must not be empty or blank."
}
}
variable "node_type_id" {
description = "Azure VM size for the pool, for example Standard_DS3_v2."
type = string
nullable = false
validation {
condition = try(length(trimspace(var.node_type_id)) > 0, false)
error_message = "node_type_id must not be empty or blank."
}
}
variable "min_idle_instances" {
description = "Instances the pool keeps ready."
type = number
validation {
condition = var.min_idle_instances == null ? true : try(var.min_idle_instances >= 0 && floor(var.min_idle_instances) == var.min_idle_instances, false)
error_message = "min_idle_instances must be an integer of at least 0."
}
}
variable "idle_instance_autotermination_minutes" {
description = "Minutes an idle instance stays in the pool above min_idle_instances."
type = number
nullable = false
validation {
condition = try(var.idle_instance_autotermination_minutes >= 0 && floor(var.idle_instance_autotermination_minutes) == var.idle_instance_autotermination_minutes, false)
error_message = "idle_instance_autotermination_minutes must be an integer of at least 0."
}
}
variable "enable_elastic_disk" {
description = "Add disk space to pool instances when they run low."
type = bool
}
variable "preloaded_spark_versions" {
description = "Databricks Runtime versions cached on pool instances."
type = list(string)
}
variable "max_capacity" {
description = "Maximum number of instances in the pool."
type = number
default = null
validation {
condition = var.max_capacity == null ? true : try(var.max_capacity >= 0 && floor(var.max_capacity) == var.max_capacity, false)
error_message = "max_capacity must be null or a nonnegative integer; zero means no limit."
}
}
variable "custom_tags" {
description = "Tags applied to pool instances."
type = map(string)
default = null
}
variable "azure_attributes" {
description = "Azure placement settings for pool instances."
type = object({
availability = optional(string)
spot_bid_max_price = optional(number)
})
default = null
}
variable "permissions" {
description = "Direct permissions on the pool. Each element names exactly one principal."
type = list(object({
permission_level = string
group_name = optional(string)
user_name = optional(string)
service_principal_name = optional(string)
}))
default = []
nullable = false
validation {
condition = try(alltrue([for permission in var.permissions :
length([for principal in [permission.group_name, permission.user_name, permission.service_principal_name] :
principal if principal != null
]) == 1 &&
alltrue([for principal in [permission.group_name, permission.user_name, permission.service_principal_name] :
principal == null ? true : length(trimspace(principal)) > 0
]) && contains(["CAN_ATTACH_TO", "CAN_MANAGE"], permission.permission_level)
]), false)
error_message = "Each permission needs exactly one nonblank principal and a supported level: CAN_ATTACH_TO, CAN_MANAGE."
}
}