-
Notifications
You must be signed in to change notification settings - Fork 175
/
variables.tf
495 lines (408 loc) · 16.3 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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
#Network Section
variable "network" {
description = "Define PortGroup and IPs/CIDR for each VM. If no CIDR provided, the subnet mask is taken from var.ipv4submask."
type = map(list(string))
default = {}
}
variable "network_delimiter" {
description = "If network name needs a delimiter for sequencing, define an UNUSED character here, otherwise leave as null"
type = string
default = null
}
variable "network_type" {
description = "Define network type for each network interface."
type = list(any)
default = null
}
variable "ipv4submask" {
description = "ipv4 Subnet mask. Warning: The order must follow the alphabetic order from var.network."
type = list(any)
default = ["24"]
}
#Data Disk section
variable "datastore_cluster" {
description = "Datastore cluster to deploy the VM."
default = ""
}
variable "datastore" {
description = "Datastore to deploy the VM."
default = ""
}
variable "data_disk" {
description = "Storage data disk parameter, example"
type = map(map(string))
default = {}
}
variable "disk_label" {
description = "Storage data disk labels."
type = list(any)
default = []
}
variable "disk_size_gb" {
description = "List of disk sizes to override template disk size."
type = list(any)
default = null
}
variable "disk_datastore" {
description = "Define where the OS disk should be stored."
type = string
default = ""
}
variable "io_reservation" {
description = "The I/O reservation (guarantee) that this disk has, in IOPS. The default is no reservation."
type = list(number)
default = []
}
variable "io_share_level" {
description = "The share allocation level for this disk. Can be one of low, normal, high, or custom. Default: normal."
type = list(string)
default = ["normal"]
}
variable "io_share_count" {
description = "The share count for this disk when the share level is custom."
type = list(number)
default = []
}
variable "disk_mode" {
description = "The disk mode for the disk."
type = list(string)
default = []
}
variable "template_storage_policy_id" {
description = "List of UUIDs of the storage policy to assign to the template disk."
type = list(any)
default = []
}
variable "scsi_bus_sharing" {
description = "scsi_bus_sharing mode, acceptable values physicalSharing,virtualSharing,noSharing."
type = string
default = null
}
variable "scsi_type" {
description = "scsi_controller type, acceptable values lsilogic,pvscsi."
type = string
default = ""
}
variable "scsi_controller" {
description = "scsi_controller number for the main OS disk."
type = number
default = 0
# validation {
# condition = var.scsi_controller < 4 && var.scsi_controller > -1
# error_message = "The scsi_controller must be between 0 and 3"
# }
}
variable "enable_disk_uuid" {
description = "Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. Default: Inherited from cloned template"
type = bool
default = null
}
variable "storage_policy_id" {
description = "(Optional) The UUID of the storage policy to assign to VM home directory."
default = null
}
###########################################
variable "vmname" {
description = "The name of the virtual machine used to deploy the vms. This name can scale out based on number of instances and vmnameformat - example can be found under exampel folder"
default = "terraformvm"
}
variable "vmnameformat" {
description = "vmname format. default is set to 2 decimal with leading 0. example: %03d for 3 decimal with leading zero or %02dprod for additional suffix"
default = "%02d"
}
variable "vmstartcount" {
description = "vmname start count value. default is set to 1. example: a value of 4 (with default format and 2 instances) will make first instance suffix 04 and second instance suffix 05"
default = 1
}
variable "staticvmname" {
description = "Static name of the virtual machin. When this option is used VM can not scale out using instance variable. You can use for_each outside the module to deploy multiple static vms with different names"
default = null
}
variable "fqdnvmname" {
description = "If true, the vm will be created using domain variable appended"
type = bool
default = false
}
variable "vmtemp" {
description = "Name of the template available in the vSphere."
}
variable "content_library" {
description = "Name of the content library where the OVF template is stored."
default = null
}
variable "instances" {
description = "number of instances you want deploy from the template."
default = 1
}
variable "cpu_number" {
description = "number of CPU (core per CPU) for the VM."
default = 2
}
variable "cpu_reservation" {
description = "The amount of CPU (in MHz) that this virtual machine is guaranteed."
default = null
}
variable "cpu_share_level" {
description = "The allocation level for CPU resources. Can be one of high, low, normal, or custom. Default: custom."
type = string
default = "normal"
}
variable "cpu_share_count" {
description = "The number of CPU shares allocated to the virtual machine when the cpu_share_level is custom."
type = number
default = 4000
}
variable "ram_size" {
description = "VM RAM size in megabytes."
default = 4096
}
variable "dc" {
description = "Name of the datacenter you want to deploy the VM to."
}
variable "vmrpid" {
description = "ID of cluster resource pool that VM will be deployed to. you use following to choose default pool in the cluster (esxi1) or (Cluster)/Resources."
default = ""
}
variable "vmrp" {
description = "Cluster resource pool that VM will be deployed to. you use following to choose default pool in the cluster (esxi1) or (Cluster)/Resources."
default = ""
}
variable "vmfolder" {
description = "The path to the folder to put this virtual machine in, relative to the datacenter that the resource pool is in. Path - The absolute path of the folder. For example, given a default datacenter of default-dc, a folder of type vm, and a folder name of terraform-test-folder, the resulting path would be /default-dc/vm/terraform-test-folder."
default = null
}
variable "vmgateway" {
description = "VM gateway to set during provisioning."
default = null
}
variable "dns_server_list" {
type = list(string)
default = null
}
#Global Customization Variables
variable "tags" {
description = "The names of any tags to attach to this resource. They must already exist."
type = map(any)
default = null
}
variable "tag_ids" {
description = "The ids of any tags to attach to this resource. They must already exist."
type = list(any)
default = null
}
variable "custom_attributes" {
description = "Map of custom attribute ids to attribute value strings to set for virtual machine."
type = map(any)
default = null
}
variable "extra_config" {
description = "Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata.'disk.enableUUID', 'True'."
type = map(any)
default = null
}
variable "annotation" {
description = "A user-provided description of the virtual machine. The default is no annotation."
default = null
}
variable "linked_clone" {
description = "Clone this virtual machine from a snapshot. Templates must have a single snapshot only in order to be eligible."
default = false
}
variable "timeout" {
description = "The timeout, in minutes, to wait for the virtual machine clone to complete."
type = number
default = 30
}
variable "dns_suffix_list" {
description = "A list of DNS search domains to add to the DNS configuration on the virtual machine."
type = list(string)
default = null
}
variable "firmware" {
description = "The firmware interface to use on the virtual machine. Can be one of bios or EFI. Default: Inherited from cloned template"
default = null
}
variable "efi_secure_boot" {
description = "Enables EFI secure boot. Can be only be true when firmware is EFI. Default: Inherited from cloned template"
default = null
}
variable "num_cores_per_socket" {
description = "The number of cores to distribute among the CPUs in this virtual machine. If specified, the value supplied to num_cpus must be evenly divisible by this value."
type = number
default = 1
}
variable "cpu_hot_add_enabled" {
description = "Allow CPUs to be added to this virtual machine while it is running."
type = bool
default = null
}
variable "cpu_hot_remove_enabled" {
description = "Allow CPUs to be removed to this virtual machine while it is running."
type = bool
default = null
}
variable "memory_hot_add_enabled" {
description = "Allow memory to be added to this virtual machine while it is running."
type = bool
default = null
}
variable "memory_reservation" {
description = "The amount of memory (in MB) that this virtual machine is guaranteed."
default = null
}
variable "memory_share_level" {
description = "The allocation level for memory resources. Can be one of high, low, normal, or custom"
type = string
default = "normal"
}
variable "memory_share_count" {
description = "(Optional) The number of memory shares allocated to the virtual machine when the memory_share_level is custom"
type = number
default = 81920
}
#Linux Customization Variables
variable "hw_clock_utc" {
description = "Tells the operating system that the hardware clock is set to UTC."
type = bool
default = true
}
variable "domain" {
description = "default VM domain for linux guest customization and fqdn name (if fqdnvmname is true)."
default = "Development.com"
}
#Windows Customization Variables
variable "is_windows_image" {
description = "Boolean flag to notify when the custom image is windows based."
type = bool
default = false
}
variable "local_adminpass" {
description = "The administrator password for this virtual machine.(Required) when using join_windomain option."
default = null
}
variable "workgroup" {
description = "The workgroup name for this virtual machine. One of this or join_domain must be included."
default = null
}
variable "windomain" {
description = "The domain to join for this virtual machine. One of this or workgroup must be included."
default = null
}
variable "domain_admin_user" {
description = "Domain admin user to join the server to AD.(Required) when using join_windomain option."
default = null
}
variable "domain_admin_password" {
description = "Doamin User pssword to join the server to AD.(Required) when using join_windomain option."
default = null
}
variable "orgname" {
description = "Organization name for when joining windows server to AD."
default = null
}
variable "auto_logon" {
description = " Specifies whether or not the VM automatically logs on as Administrator. Default: false."
type = bool
default = null
}
variable "auto_logon_count" {
description = "Specifies how many times the VM should auto-logon the Administrator account when auto_logon is true. This should be set accordingly to ensure that all of your commands that run in run_once_command_list can log in to run."
default = null
}
variable "time_zone" {
description = "The new time zone for the virtual machine. This is a numeric, sysprep-dictated, timezone code."
default = null
}
variable "run_once" {
description = "List of Comamnd to run during first logon (Automatic login set to 1)."
type = list(string)
default = null
}
variable "productkey" {
description = "Product key to be used during windows customization."
default = null
}
variable "full_name" {
description = "The full name of the user of this virtual machine. This populates the user field in the general Windows system information. Default - Administrator."
default = null
}
variable "wait_for_guest_net_routable" {
description = "Controls whether or not the guest network waiter waits for a routable address. When false, the waiter does not wait for a default gateway, nor are IP addresses checked against any discovered default gateways as part of its success criteria. This property is ignored if the wait_for_guest_ip_timeout waiter is used."
type = bool
default = true
}
variable "wait_for_guest_ip_timeout" {
description = "The amount of time, in minutes, to wait for an available guest IP address on this virtual machine. This should only be used if your version of VMware Tools does not allow the wait_for_guest_net_timeout waiter to be used. A value less than 1 disables the waiter."
type = number
default = 0
}
variable "wait_for_guest_net_timeout" {
description = "The amount of time, in minutes, to wait for an available IP address on this virtual machine's NICs. Older versions of VMware Tools do not populate this property. In those cases, this waiter can be disabled and the wait_for_guest_ip_timeout waiter can be used instead. A value less than 1 disables the waiter."
type = number
default = 5
}
variable "ignored_guest_ips" {
description = "List of IP addresses and CIDR networks to ignore while waiting for an available IP address using either of the waiters. Any IP addresses in this list will be ignored if they show up so that the waiter will continue to wait for a real IP address."
type = list(string)
default = []
}
variable "vm_depends_on" {
description = "Add any external depend on module here like vm_depends_on = [module.fw_core01.firewall]."
type = any
default = null
}
variable "tag_depends_on" {
description = "Add any external depend on module here like tag_depends_on = [vsphere_tag.foo.id]."
type = any
default = null
}
variable "hv_mode" {
description = "The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff."
type = string
default = null
}
variable "ept_rvi_mode" {
description = "The EPT/RVI (hardware memory virtualization) setting for this virtual machine."
type = string
default = null
}
variable "nested_hv_enabled" {
description = "Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest."
type = bool
default = null
}
variable "enable_logging" {
description = "Enable logging of virtual machine events to a log file stored in the virtual machine directory."
type = bool
default = null
}
variable "cpu_performance_counters_enabled" {
description = "Enable CPU performance counters on this virtual machine."
type = bool
default = null
}
variable "swap_placement_policy" {
description = "The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory."
type = string
default = null
}
variable "latency_sensitivity" {
description = "Controls the scheduling delay of the virtual machine. Use a higher sensitivity for applications that require lower latency, such as VOIP, media player applications, or applications that require frequent access to mouse or keyboard devices.Can be one of low, normal, medium, or high."
type = string
default = null
}
variable "shutdown_wait_timeout" {
description = "The amount of time, in minutes, to wait for a graceful guest shutdown when making necessary updates to the virtual machine. If force_power_off is set to true, the VM will be force powered-off after this timeout, otherwise an error is returned."
type = string
default = null
}
variable "migrate_wait_timeout" {
description = "The amount of time, in minutes, to wait for a graceful guest shutdown when making necessary updates to the virtual machine. If force_power_off is set to true, the VM will be force powered-off after this timeout, otherwise an error is returned."
type = string
default = null
}
variable "force_power_off" {
description = "If a guest shutdown failed or timed out while updating or destroying (see shutdown_wait_timeout), force the power-off of the virtual machine."
type = bool
default = null
}