-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
333 lines (312 loc) · 11 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
variable "subscription_id" {
description = "ID of the Azure subscription where the resources will be deployed."
}
variable "resource_group_name" {
description = "Name of the Azure resource group."
}
variable "location" {
default = "France Central"
description = "Location for all the resources."
}
variable "sharepoint_version" {
default = "Subscription-Latest"
description = "Version of SharePoint farm to create."
validation {
condition = contains([
"Subscription-Latest",
"Subscription-24H2",
"Subscription-24H1",
"Subscription-23H2",
"Subscription-23H1",
"Subscription-22H2",
"Subscription-RTM",
"2019",
"2016"
], var.sharepoint_version)
error_message = "Invalid SharePoint farm version."
}
}
variable "domain_fqdn" {
default = "contoso.local"
description = "FQDN of the Active Directory forest."
}
variable "front_end_servers_count" {
default = 0
description = "Number of servers with MinRole Front-end to add to the farm."
validation {
condition = var.front_end_servers_count >= 0 && var.front_end_servers_count <= 4
error_message = "The front_end_servers_count value must be between 0 and 4 included."
}
}
variable "admin_username" {
default = "yvand"
description = "Name of the Active Directory and SharePoint administrator. 'admin' and 'administrator' are not allowed."
validation {
condition = !contains([
"admin",
"administrator"
], var.admin_username)
error_message = "'admin' and 'administrator' are not allowed as value of admin_username."
}
}
variable "admin_password" {
default = ""
description = "Password for the admin account. Leave empty to auto-generate a password that will be recorded in the state file. If set, the input must meet password complexity requirements as documented in https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm-"
}
variable "other_accounts_password" {
default = ""
description = "Password for all the other accounts and the SharePoint passphrase. Leave empty to auto-generate a password that will be recorded in the state file. If set, the input must meet password complexity requirements as documented in https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm-"
}
variable "rdp_traffic_rule" {
default = "No"
description = <<EOF
Specify if a rule in the network security groups should allow the inbound RDP traffic:
- "No" (default): No rule is created, RDP traffic is blocked.
- "*" or "Internet": RDP traffic is allowed from everywhere.
- CIDR notation (e.g. 192.168.99.0/24 or 2001:1234::/64) or an IP address (e.g. 192.168.99.0 or 2001:1234::): RDP traffic is allowed from the IP address / pattern specified.
EOF
}
variable "outbound_access_method" {
default = "PublicIPAddress"
description = <<EOF
Select how the virtual machines connect to internet.
IMPORTANT: With AzureFirewallProxy, you need to either enable Azure Bastion, or manually add a public IP address to a virtual machine, to be able to connect to it.
EOF
validation {
condition = contains([
"PublicIPAddress",
"AzureFirewallProxy"
], var.outbound_access_method)
error_message = "Invalid value for outbound_access_method."
}
}
variable "enable_azure_bastion" {
default = false
type = bool
description = "Specify if Azure Bastion should be provisioned. See https://azure.microsoft.com/en-us/services/azure-bastion for more information."
}
variable "enable_hybrid_benefit_server_licenses" {
default = false
type = bool
description = "Enable the Azure Hybrid Benefit on virtual machines, to use your on-premises Windows Server licenses and reduce cost. See https://docs.microsoft.com/en-us/azure/virtual-machines/windows/hybrid-use-benefit-licensing for more information.'"
}
variable "time_zone" {
default = "Romance Standard Time"
description = "Time zone of the virtual machines. Type '[TimeZoneInfo]::GetSystemTimeZones().Id' in PowerShell to get the list."
validation {
condition = contains([
"Dateline Standard Time",
"UTC-11",
"Aleutian Standard Time",
"Hawaiian Standard Time",
"Marquesas Standard Time",
"Alaskan Standard Time",
"UTC-09",
"Pacific Standard Time (Mexico)",
"UTC-08",
"Pacific Standard Time",
"US Mountain Standard Time",
"Mountain Standard Time (Mexico)",
"Mountain Standard Time",
"Central America Standard Time",
"Central Standard Time",
"Easter Island Standard Time",
"Central Standard Time (Mexico)",
"Canada Central Standard Time",
"SA Pacific Standard Time",
"Eastern Standard Time (Mexico)",
"Eastern Standard Time",
"Haiti Standard Time",
"Cuba Standard Time",
"US Eastern Standard Time",
"Turks And Caicos Standard Time",
"Paraguay Standard Time",
"Atlantic Standard Time",
"Venezuela Standard Time",
"Central Brazilian Standard Time",
"SA Western Standard Time",
"Pacific SA Standard Time",
"Newfoundland Standard Time",
"Tocantins Standard Time",
"E. South America Standard Time",
"SA Eastern Standard Time",
"Argentina Standard Time",
"Greenland Standard Time",
"Montevideo Standard Time",
"Magallanes Standard Time",
"Saint Pierre Standard Time",
"Bahia Standard Time",
"UTC-02",
"Mid-Atlantic Standard Time",
"Azores Standard Time",
"Cape Verde Standard Time",
"UTC",
"GMT Standard Time",
"Greenwich Standard Time",
"Sao Tome Standard Time",
"Morocco Standard Time",
"W. Europe Standard Time",
"Central Europe Standard Time",
"Romance Standard Time",
"Central European Standard Time",
"W. Central Africa Standard Time",
"Jordan Standard Time",
"GTB Standard Time",
"Middle East Standard Time",
"Egypt Standard Time",
"E. Europe Standard Time",
"Syria Standard Time",
"West Bank Standard Time",
"South Africa Standard Time",
"FLE Standard Time",
"Israel Standard Time",
"Kaliningrad Standard Time",
"Sudan Standard Time",
"Libya Standard Time",
"Namibia Standard Time",
"Arabic Standard Time",
"Turkey Standard Time",
"Arab Standard Time",
"Belarus Standard Time",
"Russian Standard Time",
"E. Africa Standard Time",
"Iran Standard Time",
"Arabian Standard Time",
"Astrakhan Standard Time",
"Azerbaijan Standard Time",
"Russia Time Zone 3",
"Mauritius Standard Time",
"Saratov Standard Time",
"Georgian Standard Time",
"Volgograd Standard Time",
"Caucasus Standard Time",
"Afghanistan Standard Time",
"West Asia Standard Time",
"Ekaterinburg Standard Time",
"Pakistan Standard Time",
"Qyzylorda Standard Time",
"India Standard Time",
"Sri Lanka Standard Time",
"Nepal Standard Time",
"Central Asia Standard Time",
"Bangladesh Standard Time",
"Omsk Standard Time",
"Myanmar Standard Time",
"SE Asia Standard Time",
"Altai Standard Time",
"W. Mongolia Standard Time",
"North Asia Standard Time",
"N. Central Asia Standard Time",
"Tomsk Standard Time",
"China Standard Time",
"North Asia East Standard Time",
"Singapore Standard Time",
"W. Australia Standard Time",
"Taipei Standard Time",
"Ulaanbaatar Standard Time",
"Aus Central W. Standard Time",
"Transbaikal Standard Time",
"Tokyo Standard Time",
"North Korea Standard Time",
"Korea Standard Time",
"Yakutsk Standard Time",
"Cen. Australia Standard Time",
"AUS Central Standard Time",
"E. Australia Standard Time",
"AUS Eastern Standard Time",
"West Pacific Standard Time",
"Tasmania Standard Time",
"Vladivostok Standard Time",
"Lord Howe Standard Time",
"Bougainville Standard Time",
"Russia Time Zone 10",
"Magadan Standard Time",
"Norfolk Standard Time",
"Sakhalin Standard Time",
"Central Pacific Standard Time",
"Russia Time Zone 11",
"New Zealand Standard Time",
"UTC+12",
"Fiji Standard Time",
"Kamchatka Standard Time",
"Chatham Islands Standard Time",
"UTC+13",
"Tonga Standard Time",
"Samoa Standard Time",
"Line Islands Standard Time"
], var.time_zone)
error_message = "Invalid time zone value."
}
}
variable "auto_shutdown_time" {
default = "1900"
type = string
description = "The time (24h HHmm format) at which the virtual machines will automatically be shutdown and deallocated. Set value to '9999' to NOT configure the auto shutdown."
validation {
condition = can(regex("^\\d{4}$", var.auto_shutdown_time))
error_message = "The auto_shutdown_time value must contain 4 digits."
}
}
variable "vm_dc_size" {
default = "Standard_B2als_v2"
description = "Size of the DC virtual machine."
}
variable "vm_dc_storage" {
default = "StandardSSD_LRS"
description = "Type of storage for the managed disk. Visit https://docs.microsoft.com/en-us/rest/api/compute/disks/list#diskstorageaccounttypes for more information."
validation {
condition = contains([
"Standard_LRS",
"StandardSSD_LRS",
"StandardSSD_ZRS",
"Premium_LRS",
"PremiumV2_LRS",
"Premium_ZRS",
"UltraSSD_LRS"
], var.vm_dc_storage)
error_message = "Invalid storage type."
}
}
variable "vm_sql_size" {
default = "Standard_B2as_v2"
description = "Size of the SQL virtual machine."
}
variable "vm_sql_storage" {
default = "StandardSSD_LRS"
description = "Type of storage for the managed disk. Visit https://docs.microsoft.com/en-us/rest/api/compute/disks/list#diskstorageaccounttypes for more information."
validation {
condition = contains([
"Standard_LRS",
"StandardSSD_LRS",
"StandardSSD_ZRS",
"Premium_LRS",
"PremiumV2_LRS",
"Premium_ZRS",
"UltraSSD_LRS"
], var.vm_sql_storage)
error_message = "Invalid storage type."
}
}
variable "vm_sp_size" {
default = "Standard_B4as_v2"
description = "Size of the SharePoint virtual machine(s)."
}
variable "vm_sp_storage" {
default = "StandardSSD_LRS"
description = "Type of storage for the managed disk. Visit https://docs.microsoft.com/en-us/rest/api/compute/disks/list#diskstorageaccounttypes for more information."
validation {
condition = contains([
"Standard_LRS",
"StandardSSD_LRS",
"StandardSSD_ZRS",
"Premium_LRS",
"PremiumV2_LRS",
"Premium_ZRS",
"UltraSSD_LRS"
], var.vm_sp_storage)
error_message = "Invalid storage type."
}
}
variable "_artifactsLocation" {
default = "https://raw.githubusercontent.com/Yvand/terraform-azurerm-sharepoint/5.3.0/dsc/"
}