-
-
Notifications
You must be signed in to change notification settings - Fork 93
/
variables.tf
761 lines (638 loc) · 21 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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
variable "resource_group_name" {
description = "A container that holds related resources for an Azure solution"
default = ""
}
variable "location" {
description = "The location/region to keep all your network resources. To get the list of all locations with table format from azure cli, run 'az account list-locations -o table'"
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 "random_password_length" {
description = "The desired length of random password created by this module"
default = 24
}
variable "enable_public_ip_address" {
description = "Reference to a Public IP Address to associate with the NIC"
default = null
}
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_availability_zone" {
description = "The availability zone to allocate the Public IP in. Possible values are `Zone-Redundant`, `1`,`2`, `3`, and `No-Zone`"
default = "Zone-Redundant"
}
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 "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 "internal_dns_name_label" {
description = "The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network."
default = null
}
variable "private_ip_address_allocation_type" {
description = "The allocation method used for the Private IP Address. Possible values are Dynamic and Static."
default = "Dynamic"
}
variable "private_ip_address" {
description = "The Static IP Address which should be used. This is valid only when `private_ip_address_allocation` is set to `Static` "
default = null
}
variable "enable_vm_availability_set" {
description = "Manages an Availability Set for Virtual Machines."
default = false
}
variable "platform_fault_domain_count" {
description = "Specifies the number of fault domains that are used"
default = 3
}
variable "platform_update_domain_count" {
description = "Specifies the number of update domains that are used"
default = 5
}
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 "virtual_machine_name" {
description = "The name of the virtual machine."
default = ""
}
variable "instances_count" {
description = "The number of Virtual Machines required."
default = 1
}
variable "os_flavor" {
description = "Specify the flavor of the operating system image to deploy Virtual Machine. Valid values are `windows` and `linux`"
default = "windows"
}
variable "virtual_machine_size" {
description = "The Virtual Machine SKU for the Virtual Machine, Default is Standard_A2_V2"
default = "Standard_A2_v2"
}
variable "disable_password_authentication" {
description = "Should Password Authentication be disabled on this Virtual Machine? Defaults to true."
default = true
}
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 "source_image_id" {
description = "The ID of an Image which each Virtual Machine should be based on"
default = null
}
variable "dedicated_host_id" {
description = "The ID of a Dedicated Host where this machine should be run on."
default = null
}
variable "custom_data" {
description = "Base64 encoded file of a bash script that gets run once by cloud-init upon VM creation"
default = null
}
variable "enable_automatic_updates" {
description = "Specifies if Automatic Updates are Enabled for the Windows Virtual Machine."
default = false
}
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 "vm_availability_zone" {
description = "The Zone in which this Virtual Machine should be created. Conflicts with availability set and shouldn't use both"
default = null
}
variable "patch_mode" {
description = "Specifies the mode of in-guest patching to this Windows Virtual Machine. Possible values are `Manual`, `AutomaticByOS` and `AutomaticByPlatform`"
default = "AutomaticByOS"
}
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 "vm_time_zone" {
description = "Specifies the Time Zone which should be used by the Virtual Machine"
default = null
}
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 authenticate Linux virtual machine"
default = null
}
variable "custom_image" {
description = "Provide the custom image to this module if the default variants are not sufficient"
type = map(object({
publisher = string
offer = string
sku = string
version = string
}))
default = null
}
variable "linux_distribution_list" {
description = "Pre-defined Azure Linux VM images 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"
},
ubuntu1904 = {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "19.04"
version = "latest"
},
ubuntu2004 = {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-focal-daily"
sku = "20_04-daily-lts"
version = "latest"
},
ubuntu2004-gen2 = {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-focal-daily"
sku = "20_04-daily-lts-gen2"
version = "latest"
},
centos77 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "7.7"
version = "latest"
},
centos78-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "7_8-gen2"
version = "latest"
},
centos79-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "7_9-gen2"
version = "latest"
},
centos81 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "8_1"
version = "latest"
},
centos81-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "8_1-gen2"
version = "latest"
},
centos82-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "8_2-gen2"
version = "latest"
},
centos83-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "8_3-gen2"
version = "latest"
},
centos84-gen2 = {
publisher = "OpenLogic"
offer = "CentOS"
sku = "8_4-gen2"
version = "latest"
},
coreos = {
publisher = "CoreOS"
offer = "CoreOS"
sku = "Stable"
version = "latest"
},
rhel78 = {
publisher = "RedHat"
offer = "RHEL"
sku = "7.8"
version = "latest"
},
rhel78-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "78-gen2"
version = "latest"
},
rhel79 = {
publisher = "RedHat"
offer = "RHEL"
sku = "7.9"
version = "latest"
},
rhel79-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "79-gen2"
version = "latest"
},
rhel81 = {
publisher = "RedHat"
offer = "RHEL"
sku = "8.1"
version = "latest"
},
rhel81-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "81gen2"
version = "latest"
},
rhel82 = {
publisher = "RedHat"
offer = "RHEL"
sku = "8.2"
version = "latest"
},
rhel82-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "82gen2"
version = "latest"
},
rhel83 = {
publisher = "RedHat"
offer = "RHEL"
sku = "8.3"
version = "latest"
},
rhel83-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "83gen2"
version = "latest"
},
rhel84 = {
publisher = "RedHat"
offer = "RHEL"
sku = "8.4"
version = "latest"
},
rhel84-gen2 = {
publisher = "RedHat"
offer = "RHEL"
sku = "84gen2"
version = "latest"
},
rhel84-byos = {
publisher = "RedHat"
offer = "rhel-byos"
sku = "rhel-lvm84"
version = "latest"
},
rhel84-byos-gen2 = {
publisher = "RedHat"
offer = "rhel-byos"
sku = "rhel-lvm84-gen2"
version = "latest"
},
mssql2019ent-rhel8 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-rhel8"
sku = "enterprise"
version = "latest"
},
mssql2019std-rhel8 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-rhel8"
sku = "standard"
version = "latest"
},
mssql2019dev-rhel8 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-rhel8"
sku = "sqldev"
version = "latest"
},
mssql2019ent-ubuntu1804 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu1804"
sku = "enterprise"
version = "latest"
},
mssql2019std-ubuntu1804 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu1804"
sku = "standard"
version = "latest"
},
mssql2019dev-ubuntu1804 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu1804"
sku = "sqldev"
version = "latest"
},
mssql2019ent-ubuntu2004 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu2004"
sku = "enterprise"
version = "latest"
},
mssql2019std-ubuntu2004 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu2004"
sku = "standard"
version = "latest"
},
mssql2019dev-ubuntu2004 = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ubuntu2004"
sku = "sqldev"
version = "latest"
},
}
}
variable "linux_distribution_name" {
default = "ubuntu1804"
description = "Variable to pick an OS flavour for Linux based VM. Possible values include: centos8, ubuntu1804"
}
variable "windows_distribution_list" {
description = "Pre-defined Azure Windows VM images 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"
},
windows2019dc-gensecond = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-datacenter-gensecond"
version = "latest"
},
windows2019dc-gs = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-datacenter-gs"
version = "latest"
},
windows2019dc-containers = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-Datacenter-with-Containers"
version = "latest"
},
windows2019dc-containers-g2 = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-datacenter-with-containers-g2"
version = "latest"
},
windows2019dccore = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-Datacenter-Core"
version = "latest"
},
windows2019dccore-g2 = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2019-datacenter-core-g2"
version = "latest"
},
windows2016dccore = {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter-Server-Core"
version = "latest"
},
mssql2017exp = {
publisher = "MicrosoftSQLServer"
offer = "SQL2017-WS2019"
sku = "express"
version = "latest"
},
mssql2017dev = {
publisher = "MicrosoftSQLServer"
offer = "SQL2017-WS2019"
sku = "sqldev"
version = "latest"
},
mssql2017std = {
publisher = "MicrosoftSQLServer"
offer = "SQL2017-WS2019"
sku = "standard"
version = "latest"
},
mssql2017ent = {
publisher = "MicrosoftSQLServer"
offer = "SQL2017-WS2019"
sku = "enterprise"
version = "latest"
},
mssql2019std = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ws2019"
sku = "standard"
version = "latest"
},
mssql2019dev = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ws2019"
sku = "sqldev"
version = "latest"
},
mssql2019ent = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ws2019"
sku = "enterprise"
version = "latest"
},
mssql2019ent-byol = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ws2019-byol"
sku = "enterprise"
version = "latest"
},
mssql2019std-byol = {
publisher = "MicrosoftSQLServer"
offer = "sql2019-ws2019-byol"
sku = "standard"
version = "latest"
}
}
}
variable "windows_distribution_name" {
default = "windows2019dc"
description = "Variable to pick an OS flavour for Windows based VM. 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 Machine 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 "os_disk_name" {
description = "The name which should be used for the Internal OS Disk"
default = null
}
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 "managed_identity_type" {
description = "The type of Managed Identity which should be assigned to the Linux Virtual Machine. 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."
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 "data_disks" {
description = "Managed Data Disks for azure viratual machine"
type = list(object({
name = string
storage_account_type = string
disk_size_gb = number
}))
default = []
}
variable "nsg_diag_logs" {
description = "NSG Monitoring Category details for Azure Diagnostic setting"
default = ["NetworkSecurityGroupEvent", "NetworkSecurityGroupRuleCounter"]
}
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 "storage_account_name" {
description = "The name of the hub storage account to store logs"
default = null
}
variable "deploy_log_analytics_agent" {
description = "Install log analytics agent to windows or linux VM"
default = false
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}