-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
variables.tf
549 lines (451 loc) · 18.8 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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
variable "resource_group_name" {
description = "A container that holds related resources for an Azure solution"
default = ""
}
variable "virtual_network_name" {
description = "The name of the virtual network"
default = ""
}
variable "subnet_name" {
description = "The name of the subnet to use in VM scale set"
default = ""
}
variable "storage_account_name" {
description = "The name of the hub storage account to store logs"
default = null
}
variable "random_password_length" {
description = "The desired length of random password created by this module"
default = 24
}
variable "public_ip_allocation_method" {
description = "Defines the allocation method for this IP address. Possible values are `Static` or `Dynamic`"
default = "Static"
}
variable "public_ip_sku" {
description = "The SKU of the Public IP. Accepted values are `Basic` and `Standard`"
default = "Standard"
}
variable "domain_name_label" {
description = "Label for the Domain Name. Will be used to make up the FQDN. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system."
default = null
}
variable "public_ip_sku_tier" {
description = "The SKU Tier that should be used for the Public IP. Possible values are `Regional` and `Global`"
default = "Regional"
}
variable "enable_load_balancer" {
description = "Controls if public load balancer should be created"
default = true
}
variable "load_balancer_type" {
description = "Controls the type of load balancer should be created. Possible values are public and private"
default = "private"
}
variable "load_balancer_sku" {
description = "The SKU of the Azure Load Balancer. Accepted values are Basic and Standard."
default = "Standard"
}
variable "private_ip_address_allocation_type" {
description = "The allocation method for the Private IP Address used by this Load Balancer. Possible values as Dynamic and Static."
default = "Dynamic"
}
variable "lb_private_ip_address" {
description = "Private IP Address to assign to the Load Balancer."
default = null
}
variable "lb_probe_protocol" {
description = "Specifies the protocol of the end point. Possible values are `Http`, `Https` or `Tcp`. If `Tcp` is specified, a received ACK is required for the probe to be successful. If `Http` is specified, a `200 OK` response from the specified `URI` is required for the probe to be successful."
default = null
}
variable "lb_probe_request_path" {
description = "The URI used for requesting health status from the backend endpoint. Required if protocol is set to `Http` or `Https`. Otherwise, it is not allowed"
default = null
}
variable "number_of_probes" {
description = "The number of failed probe attempts after which the backend endpoint is removed from rotation. The default value is `2`. `NumberOfProbes` multiplied by `intervalInSeconds` value must be greater or equal to 10.Endpoints are returned to rotation when at least one probe is successful."
default = null
}
variable "enable_lb_nat_pool" {
description = "If enabled load balancer nat pool will be created for SSH if flavor is linux and for winrm if flavour is windows"
default = false
}
variable "nat_pool_frontend_ports" {
description = "Optional override for default NAT ports"
type = list(number)
default = [50000, 50119]
}
variable "load_balancer_health_probe_port" {
description = "Port on which the Probe queries the backend endpoint. Default `80`"
default = 80
}
variable "load_balanced_port_list" {
description = "List of ports to be forwarded through the load balancer to the VMs"
type = list(number)
default = []
}
variable "enable_proximity_placement_group" {
description = "Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets."
default = false
}
variable "existing_network_security_group_id" {
description = "The resource id of existing network security group"
default = null
}
variable "nsg_inbound_rules" {
description = "List of network rules to apply to network interface."
default = []
}
variable "os_flavor" {
description = "Specify the flavour of the operating system image to deploy VMSS. Valid values are `windows` and `linux`"
default = "windows"
}
variable "vmscaleset_name" {
description = "The prefix which should be used for the name of the Virtual Machines in this Scale Set. If unspecified this defaults to the value for the name field. If the value of the name field is not a valid computer_name_prefix, then you must specify computer_name_prefix"
default = ""
}
variable "computer_name_prefix" {
description = "Specifies the name of the virtual machine inside the VM scale set"
default = null
}
variable "virtual_machine_size" {
description = "The Virtual Machine SKU for the Scale Set, Default is Standard_A2_V2"
default = "Standard_A2_v2"
}
variable "instances_count" {
description = "The number of Virtual Machines in the Scale Set."
default = 2
}
variable "admin_username" {
description = "The username of the local administrator used for the Virtual Machine."
default = "azureadmin"
}
variable "admin_password" {
description = "The Password which should be used for the local-administrator on this Virtual Machine"
default = null
}
variable "custom_data" {
description = "The Base64-Encoded Custom Data which should be used for this Virtual Machine Scale Set."
default = null
}
variable "disable_password_authentication" {
description = "Should Password Authentication be disabled on this Virtual Machine Scale Set? Defaults to true."
default = true
}
variable "overprovision" {
description = "Should Azure over-provision Virtual Machines in this Scale Set? This means that multiple Virtual Machines will be provisioned and Azure will keep the instances which become available first - which improves provisioning success rates and improves deployment time. You're not billed for these over-provisioned VM's and they don't count towards the Subscription Quota. Defaults to true."
default = false
}
variable "do_not_run_extensions_on_overprovisioned_machines" {
description = "Should Virtual Machine Extensions be run on Overprovisioned Virtual Machines in the Scale Set?"
default = false
}
variable "enable_windows_vm_automatic_updates" {
description = "Are automatic updates enabled for Windows Virtual Machine in this scale set?"
default = true
}
variable "enable_encryption_at_host" {
description = " Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host?"
default = false
}
variable "license_type" {
description = "Specifies the type of on-premise license which should be used for this Virtual Machine. Possible values are None, Windows_Client and Windows_Server."
default = "None"
}
variable "platform_fault_domain_count" {
description = "Specifies the number of fault domains that are used by this Linux Virtual Machine Scale Set."
default = null
}
variable "scale_in_policy" {
description = "The scale-in policy rule that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled in. Possible values for the scale-in policy rules are `Default`, `NewestVM` and `OldestVM`"
default = "Default"
}
variable "single_placement_group" {
description = "Allow to have cluster of 100 VMs only"
default = true
}
variable "source_image_id" {
description = "The ID of an Image which each Virtual Machine in this Scale Set should be based on"
default = null
}
variable "os_upgrade_mode" {
description = "Specifies how Upgrades (e.g. changing the Image/SKU) should be performed to Virtual Machine Instances. Possible values are Automatic, Manual and Rolling. Defaults to Automatic"
default = "Automatic"
}
variable "vm_time_zone" {
description = "Specifies the Time Zone which should be used by the Virtual Machine"
default = null
}
variable "availability_zones" {
description = "A list of Availability Zones in which the Virtual Machines in this Scale Set should be created in"
default = null #[1, 2, 3]
}
variable "availability_zone_balance" {
description = "Should the Virtual Machines in this Scale Set be strictly evenly distributed across Availability Zones?"
default = false
}
variable "generate_admin_ssh_key" {
description = "Generates a secure private key and encodes it as PEM."
default = false
}
variable "admin_ssh_key_data" {
description = "specify the path to the existing ssh key to authenciate linux vm"
default = null
}
variable "custom_image" {
description = "Proive the custom image to this module if the default variants are not sufficient"
type = object({
publisher = string
offer = string
sku = string
version = string
})
default = null
}
variable "linux_distribution_list" {
type = map(object({
publisher = string
offer = string
sku = string
version = string
}))
default = {
ubuntu1604 = {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
ubuntu1804 = {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "18.04-LTS"
version = "latest"
}
centos8 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "7.5"
version = "latest"
}
coreos = {
publisher = "CoreOS"
offer = "CoreOS"
sku = "Stable"
version = "latest"
}
}
}
variable "linux_distribution_name" {
type = string
default = "ubuntu1804"
description = "Variable to pick an OS flavour for Linux based VMSS possible values include: centos8, ubuntu1804"
}
variable "windows_distribution_list" {
type = map(object({
publisher = string
offer = string
sku = string
version = string
}))
default = {
windows2012r2dc = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2012-R2-Datacenter"
version = "latest"
}
windows2016dc = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter"
version = "latest"
}
windows2019dc = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-Datacenter"
version = "latest"
}
mssql2017exp = {
publisher = "MicrosoftSQLServer"
offer = "SQL2017-WS2016"
sku = "Express"
version = "latest"
}
}
}
variable "windows_distribution_name" {
type = string
default = "windows2019dc"
description = "Variable to pick an OS flavour for Windows based VMSS possible values include: winserver, wincore, winsql"
}
variable "os_disk_storage_account_type" {
description = "The Type of Storage Account which should back this the Internal OS Disk. Possible values include `Standard_LRS`, `StandardSSD_LRS` and `Premium_LRS`."
default = "StandardSSD_LRS"
}
variable "os_disk_caching" {
description = "The Type of Caching which should be used for the Internal OS Disk. Possible values are `None`, `ReadOnly` and `ReadWrite`"
default = "ReadWrite"
}
variable "disk_encryption_set_id" {
description = "The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk. The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault"
default = null
}
variable "disk_size_gb" {
description = "The Size of the Internal OS Disk in GB, if you wish to vary from the size used in the image this Virtual Scale Set is sourced from."
default = null
}
variable "enable_os_disk_write_accelerator" {
description = "Should Write Accelerator be Enabled for this OS Disk? This requires that the `storage_account_type` is set to `Premium_LRS` and that `caching` is set to `None`."
default = false
}
variable "enable_ultra_ssd_data_disk_storage_support" {
description = "Should the capacity to enable Data Disks of the UltraSSD_LRS storage account type be supported on this Virtual Machine"
default = false
}
variable "additional_data_disks" {
description = "Adding additional disks capacity to add each instance (GB)"
type = list(number)
default = []
}
variable "additional_data_disks_storage_account_type" {
description = "The Type of Storage Account which should back this Data Disk. Possible values include Standard_LRS, StandardSSD_LRS, Premium_LRS and UltraSSD_LRS."
default = "Standard_LRS"
}
variable "dns_servers" {
description = "List of dns servers to use for network interface"
default = []
}
variable "enable_ip_forwarding" {
description = "Should IP Forwarding be enabled? Defaults to false"
default = false
}
variable "enable_accelerated_networking" {
description = "Should Accelerated Networking be enabled? Defaults to false."
default = false
}
variable "assign_public_ip_to_each_vm_in_vmss" {
description = "Create a virtual machine scale set that assigns a public IP address to each VM"
default = false
}
variable "public_ip_prefix_id" {
description = "The ID of the Public IP Address Prefix from where Public IP Addresses should be allocated"
default = null
}
variable "rolling_upgrade_policy" {
description = "Enabling automatic OS image upgrades on your scale set helps ease update management by safely and automatically upgrading the OS disk for all instances in the scale set."
type = object({
max_batch_instance_percent = number
max_unhealthy_instance_percent = number
max_unhealthy_upgraded_instance_percent = number
pause_time_between_batches = string
})
default = {
max_batch_instance_percent = 20
max_unhealthy_instance_percent = 20
max_unhealthy_upgraded_instance_percent = 20
pause_time_between_batches = "PT0S"
}
}
variable "enable_automatic_instance_repair" {
description = "Should the automatic instance repair be enabled on this Virtual Machine Scale Set?"
default = false
}
variable "grace_period" {
description = "Amount of time (in minutes, between 30 and 90, defaults to 30 minutes) for which automatic repairs will be delayed."
default = "PT30M"
}
variable "managed_identity_type" {
description = "The type of Managed Identity which should be assigned to the Linux Virtual Machine Scale Set. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`"
default = null
}
variable "managed_identity_ids" {
description = " A list of User Managed Identity ID's which should be assigned to the Linux Virtual Machine Scale Set."
default = null
}
variable "winrm_protocol" {
description = "Specifies the protocol of winrm listener. Possible values are `Http` or `Https`"
default = null
}
variable "key_vault_certificate_secret_url" {
description = "The Secret URL of a Key Vault Certificate, which must be specified when `protocol` is set to `Https`"
default = null
}
variable "additional_unattend_content" {
description = "The XML formatted content that is added to the unattend.xml file for the specified path and component."
default = null
}
variable "additional_unattend_content_setting" {
description = "The name of the setting to which the content applies. Possible values are `AutoLogon` and `FirstLogonCommands`"
default = null
}
variable "enable_boot_diagnostics" {
description = "Should the boot diagnostics enabled?"
default = false
}
variable "storage_account_uri" {
description = "The Primary/Secondary Endpoint for the Azure Storage Account which should be used to store Boot Diagnostics, including Console Output and Screenshots from the Hypervisor. Passing a `null` value will utilize a Managed Storage Account to store Boot Diagnostics."
default = null
}
variable "enable_autoscale_for_vmss" {
description = "Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets"
default = false
}
variable "minimum_instances_count" {
description = "The minimum number of instances for this resource. Valid values are between 0 and 1000"
default = null
}
variable "maximum_instances_count" {
description = "The maximum number of instances for this resource. Valid values are between 0 and 1000"
default = ""
}
variable "scale_out_cpu_percentage_threshold" {
description = "Specifies the threshold % of the metric that triggers the scale out action."
default = "80"
}
variable "scale_in_cpu_percentage_threshold" {
description = "Specifies the threshold of the metric that triggers the scale in action."
default = "20"
}
variable "scaling_action_instances_number" {
description = "The number of instances involved in the scaling action"
default = "1"
}
variable "nsg_diag_logs" {
description = "NSG Monitoring Category details for Azure Diagnostic setting"
default = ["NetworkSecurityGroupEvent", "NetworkSecurityGroupRuleCounter"]
}
variable "pip_diag_logs" {
description = "Load balancer Public IP Monitoring Category details for Azure Diagnostic setting"
default = ["DDoSProtectionNotifications", "DDoSMitigationFlowLogs", "DDoSMitigationReports"]
}
variable "lb_diag_logs" {
description = "Load balancer Category details for Azure Diagnostic setting"
default = ["LoadBalancerAlertEvent"]
}
variable "deploy_log_analytics_agent" {
description = "Install log analytics agent to windows or linux VM scaleset instances"
default = false
}
variable "log_analytics_workspace_id" {
description = "The name of log analytics workspace resource id"
default = null
}
variable "log_analytics_customer_id" {
description = "The Workspace (or Customer) ID for the Log Analytics Workspace."
default = null
}
variable "log_analytics_workspace_primary_shared_key" {
description = "The Primary shared key for the Log Analytics Workspace"
default = null
}
variable "intall_iis_server_on_instances" {
description = "Install ISS server on every Instance in the VM scale set"
default = false
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}