-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
213 lines (178 loc) · 5.67 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
variable "os_type" {
description = "Specify the Operating System time"
default = "windows_server"
validation {
condition = contains(["windows", "windows_server", "linux"], var.os_type)
error_message = "Provide a valid value."
}
}
variable "location" {
description = "Provide the Azure region"
default = "westeurope"
}
variable "purpose" {
description = "Purpose is used in the naming of the VM"
validation {
condition = length(var.purpose) < 7
error_message = "The purpose value must not exceed 6 characters."
}
}
variable "subnet_id" {
description = "Provide the ID of the subnet that the VM should use"
}
variable "vm_size" {
default = "Standard_B2s"
}
variable "workspace_id" {
description = "Provide the Log Analytics Workspace ID for the VM to report data to"
default = null
}
variable "workspace_key" {
description = "Provide the Log Analytics Workspace key for the VM to report data to"
default = null
}
variable "enable_jit" {
description = "Enables Just-in-Time Administration"
default = false
}
variable "shutdown_policy_enabled" {
default = "true" # Cannot be bool. TODO: Convert bool to string in TF file
}
variable "deploy_public_ip_address" {
default = false
}
variable "dns_host_record" {
description = "DNS Host record will only be set when deploying a public IP address"
# This would have been nice...
# validation {
# condition = var.deploy_public_ip_address == true
# error_message = "DNS Host record cannot be set without deploying a public IP address. Set 'deploy_public_ip_address' to true or unset this variable"
# }
default = false
}
variable "install_oms_agent" {
description = "Installs the OMS Agent"
default = false
}
variable "enable_ip_forwarding" {
default = false
}
variable "custom_data" {
type = string
default = null
description = "Base64encoded string of the custom data config"
}
variable "source_image_reference" {
type = map(string)
default = {
publisher = null
offer = null
sku = null
version = null
}
}
variable "join_in_aad" {
default = true
description = "Joins the machine in Azure Active Directory"
}
variable "instances" {
description = "Specify the number of VM instances"
type = number
default = 1
validation {
condition = var.instances < 4
error_message = "Currently not possible to deploy more than 3 VMs due to the availability zones config on the VM"
}
}
variable "tags" {
type = map(string)
default = {}
}
variable "config" {
description = "Provide the decoded data from the files in generic/json/config"
}
variable "deploy_in_availability_set" {
description = "Instead of using Availability Zones (99.99% SLA - DC failure protection), the VMs will be deployed in an Availability Set (99.9% SLA - 'rack failure' protection)."
default = false
}
variable "data_disk_size" {
description = "Deploys a data disk if size is >0"
validation {
condition = contains([0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048], var.data_disk_size)
error_message = "Provide a valid value."
}
default = 0
}
variable "data_disk_caching" {
description = "Specify the caching setting for the data disk"
default = "ReadWrite"
validation {
condition = contains(["None", "ReadOnly", "ReadWrite"], var.data_disk_caching)
error_message = "Provide a valid value."
}
}
variable "data_disk_type" {
description = "Specify the disk type for the data disk"
default = "StandardSSD_LRS"
validation {
condition = contains(["Standard_LRS", "StandardSSD_ZRS", "Premium_LRS", "PremiumV2_LRS", "Premium_ZRS", "StandardSSD_LRS", "UltraSSD_LRS"], var.data_disk_type)
error_message = "Provide a valid value."
}
}
variable "disable_backup" {
description = "Requests a policy exemption for backups on the VM in the Resource Group"
default = false
}
variable "shared_data_disk_size" {
description = "Deploys a shared data disk if size is >0"
validation {
condition = contains([0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048], var.shared_data_disk_size)
error_message = "Provide a valid value."
}
default = 0
}
variable "shared_disk_caching" {
description = "Specify the caching setting for the shared disk"
default = "ReadWrite"
validation {
condition = contains(["None", "ReadOnly", "ReadWrite"], var.shared_disk_caching)
error_message = "Provide a valid value."
}
}
variable "shared_disk_type" {
description = "Specify the disk type for the shared disk"
default = "StandardSSD_LRS"
validation {
condition = contains(["Standard_LRS", "StandardSSD_ZRS", "Premium_LRS", "PremiumV2_LRS", "Premium_ZRS", "StandardSSD_LRS", "UltraSSD_LRS"], var.shared_disk_type)
error_message = "Provide a valid value."
}
}
variable "deploy_load_balancer" {
description = "Deploys a load balancer and adds the network interfaces to the backend pool"
default = false
}
variable "load_balancer_health_probe_port" {
description = "Health probe port, default is 22 for Linux and 3389 for Windows"
default = 0
}
variable "load_balancer_is_public" {
description = "If true, a Public IP address will be created and associated"
default = false
}
variable "custom_script_extension" {
description = "Installs the specified custom script extension. Script should be a base64encoded string"
default = {
enabled = false
name = null
script = null
}
}
variable "avd_extension" {
description = "Installs the Azure Virtual Desktop extension"
default = {
enabled = false
hostPoolName = null
aadJoin = true
registrationInfoToken = null
}
}