-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
289 lines (278 loc) · 9.31 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
## Ocean Variables ##
variable "name" {
type = string
default = null
description = "The Ocean cluster name."
}
variable "cluster_name" {
type = string
description = "The ECS cluster name."
}
variable "region" {
type = string
description = "The region the cluster will run in."
}
variable "max_size" {
type = number
default = 1000
description = "The upper limit of instances the cluster can scale up to."
}
variable "min_size" {
type = number
default = 0
description = "The lower limit of instances the cluster can scale down to."
}
variable "desired_capacity" {
type = number
default = null
description = "The number of instances to launch and maintain in the cluster."
}
variable "subnet_ids" {
type = list(string)
description = "A comma-separated list of subnet identifiers for the Ocean cluster. Subnet IDs should be configured with auto assign public ip."
}
variable "tags" {
type = map(string)
default = null
description = "Optionally adds tags to instances launched in an Ocean cluster."
}
variable "whitelist" {
type = list(string)
default = null
description = "Instance types allowed in the Ocean cluster, Cannot be configured if blacklist is configured."
}
#variable "blacklist" {
# type = list(string)
# default = null
# description = "Instance types allowed in the Ocean cluster, Cannot be configured if whitelist is configured."
#}
variable "user_data" {
type = string
default = null
description = "Base64-encoded MIME user data to make available to the instances."
}
variable "image_id" {
type = string
default = null
description = "ID of the image used to launch the instances."
}
variable "security_group_ids" {
type = list(string)
description = "One or more security group ids."
}
variable "key_pair" {
type = string
default = null
description = "The key pair to attach the instances."
}
variable "iam_instance_profile" {
type = string
default = null
description = "The instance profile iam role"
}
variable "associate_public_ip_address" {
type = bool
default = null
description = "Configure public IP address allocation."
}
variable "utilize_reserved_instances" {
type = bool
default = true
description = "If Reserved instances exist, Ocean will utilize them before launching Spot instances."
}
variable "draining_timeout" {
type = number
default = 120
description = "The time in seconds, the instance is allowed to run while detached from the ELB. This is to allow the instance time to be drained from incoming TCP connections before terminating it, during a scale down operation."
}
variable "monitoring" {
type = bool
default = false
description = "Enable detailed monitoring for cluster. Flag will enable Cloud Watch detailed monitoring (one minute increments). Note: there are additional hourly costs for this service based on the region used."
}
variable "ebs_optimized" {
type = bool
default = true
description = "Enable EBS optimized for cluster. Flag will enable optimized capacity for high bandwidth connectivity to the EB service for non EBS optimized instance types. For instances that are EBS optimized this flag will be ignored."
}
variable "spot_percentage" {
type = number
default = null
description = "The percentage of Spot instances"
}
variable "utilize_commitments" {
type = bool
default = null
description = "If savings plans exist, Ocean will utilize them before launching Spot instances."
}
variable "availability_vs_cost" {
type = string
default = "balanced"
description = "You can control the approach that Ocean takes while launching nodes by configuring this value. Possible values: costOriented,balanced,cheapest"
}
variable "http_tokens" {
type = string
default = null
description = "Determines if a signed token is required or not. Valid values: optional or required."
}
variable "http_put_response_hop_limit" {
type = number
default = null
description = "An integer from 1 through 64. The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further the instance metadata requests can travel."
}
###################
## Block Device Mappings ##
variable "block_device_mappings" {
type = object({
device_name = string
delete_on_termination = bool
encrypted = bool
kms_key_id = string
snapshot_id = string
volume_type = string
iops = number
volume_size = number
throughput = number
no_device = string
})
default = null
description = "Block Device Mapping Object"
}
variable "dynamic_volume_size" {
type = object({
base_size = number
resource = string
size_per_resource_unit = number
})
default = null
description = "dynamic_volume_size Object"
}
##################
## optimize images ##
variable "perform_at" {
type = string
default = "always"
description = "Needs to be one of the following values: never/always/timeWindow."
}
variable "time_windows" {
type = list(string)
default = null
description = "Example: ['Sun:02:00-Sun:12:00', 'Wed:01:01-Fri:02:03']"
}
variable "should_optimize_ecs_ami" {
type = bool
default = true
}
##################
## Auto Scaler ##
variable "autoscaler_is_enabled" {
type = bool
default = true
description = "Enable the Ocean ECS autoscaler."
}
variable "autoscaler_is_auto_config" {
type = bool
default = true
description = "Automatically configure and optimize headroom resources."
}
variable "cooldown" {
type = number
default = null
description = "Cooldown period between scaling actions."
}
###################
## Headroom ##
variable "cpu_per_unit" {
type = number
default = 0
description = "Optionally configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU."
}
variable "memory_per_unit" {
type = number
default = 0
description = "Optionally configure the amount of memory (MB) to allocate the headroom."
}
variable "num_of_units" {
type = number
default = 0
description = "The number of units to retain as headroom, where each unit has the defined headroom CPU and memory."
}
###################
## Down ##
variable "max_scale_down_percentage" {
type = number
default = 10
description = "Would represent the maximum % to scale-down. Number between 1-100."
}
variable "max_vcpu" {
type = number
default = null
description = "The maximum cpu in vCPU units that can be allocated to the cluster."
}
variable "max_memory_gib" {
type = number
default = null
description = "The maximum memory in GiB units that can be allocated to the cluster."
}
variable "auto_headroom_percentage" {
type = number
default = null
description = "The auto-headroom percentage. Set a number between 0-200 to control the headroom % of the cluster. Relevant when isAutoConfig= true."
}
###################
## Update Policy ##
variable "should_roll" {
type = bool
default = false
description = "Enables the roll."
}
variable "conditional_roll" {
type = bool
default = false
description = "Spot will perform a cluster Roll in accordance with a relevant modification of the cluster’s settings. When set to true , only specific changes in the cluster’s configuration will trigger a cluster roll (such as AMI, Key Pair, user data, instance types, load balancers, etc)."
}
variable "auto_apply_tags" {
type = bool
default = false
description = "will update instance tags on the fly without rolling the cluster."
}
variable "batch_size_percentage" {
type = number
default = 20
description = "Sets the percentage of the instances to deploy in each batch."
}
variable "batch_min_healthy_percentage" {
type = number
default = 50
description = "Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the cluster roll will fail. If exists, the parameter value will be in range of 1-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch."
}
###################
## Scheduled Task ##
variable "scheduled_task" {
type = object({
shutdown_is_enabled = bool
shutdown_time_windows = list(string)
taskscheduling_is_enabled = bool
cron_expression = string
task_type = string
})
default = null
description = "Scheduled Tasks Block"
}
#####################
## S3 Logging ##
variable "data_integration_id" {
type = string
default = null
description = "The identifier of The S3 data integration to export the logs to."
}
variable "fallback_to_ondemand" {
type = bool
default = true
description = "Launch On-Demand in the event there are no spot instances available"
}
variable "use_as_template_only" {
type = bool
default = false
description = "Use the Ocean cluster as a template only."
}