-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
557 lines (473 loc) · 16.9 KB
/
variables.tf
File metadata and controls
557 lines (473 loc) · 16.9 KB
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
variable "prefix" {
description = "(Optional) Specifies the prefix for the name of the Azure resources."
type = string
default = "local"
validation {
condition = var.prefix == null || length(var.prefix) >= 2
error_message = "The prefix must be at least 2 characters long."
}
}
variable "suffix" {
description = "(Optional) Specifies the suffix for the name of the Azure resources."
type = string
default = "test"
validation {
condition = var.suffix == null || length(var.suffix) >= 2
error_message = "The suffix must be at least 2 characters long."
}
}
variable "location" {
description = "(Required) Specifies the location for all resources."
type = string
default = "westeurope"
}
variable "primary_region" {
description = "(Required) Specifies the primary region for the Azure Cosmos DB account."
type = string
default = "westeurope"
}
variable "secondary_region" {
description = "(Required) Specifies the secondary region for the Azure Cosmos DB account."
type = string
default = "northeurope"
}
variable "mongodb_server_version" {
description = "(Optional) Specifies the version of MongoDB API for the Azure Cosmos DB account."
type = string
default = "7.0"
validation {
condition = contains([
"3.2",
"3.6",
"4.0",
"4.2",
"5.0",
"6.0",
"7.0",
"8.0"
], var.mongodb_server_version)
error_message = "The mongodb_server_version must be one of the supported versions: 3.2, 3.6, 4.0, 4.2, 5.0, 6.0, 7.0, 8.0."
}
}
variable "database_throughput" {
description = "(Optional) Specifies the throughput for the MongoDB database."
type = number
default = 400
}
variable "consistency_level" {
description = "(Required) Specifies the consistency level for the Azure Cosmos DB account."
type = string
default = "Eventual"
validation {
condition = contains([
"Strong",
"BoundedStaleness",
"Session",
"Eventual"
], var.consistency_level)
error_message = "The consistency_level must be one of the allowed values."
}
}
variable "cosmosdb_database_name" {
description = "(Optional) Specifies the name of the Azure Cosmos DB for MongoDB database."
type = string
default = "sampledb"
}
variable "cosmosdb_collection_name" {
description = "(Optional) Specifies the name of the Azure Cosmos DB for MongoDB collection."
type = string
default = "activities"
}
variable "mongodb_index_keys" {
description = "A list of field names for which to create single-field indexes on the MongoDB collection."
type = list(string)
default = ["_id", "username", "activity", "timestamp"]
}
variable "os_type" {
description = "(Required) Specifies the O/S type for the App Services to be hosted in this plan. Possible values include Windows, Linux, and WindowsContainer. Changing this forces a new resource to be created."
type = string
default = "Linux"
validation {
condition = contains([
"Windows",
"Linux",
"WindowsContainer"
], var.os_type)
error_message = "The os_type must be either 'Windows', 'Linux', or 'WindowsContainer'."
}
}
variable "zone_balancing_enabled" {
description = "(Optional) Should the Service Plan balance across Availability Zones in the region."
type = bool
default = false
}
variable "sku_tier" {
description = "(Optional) Specifies the tier name for the hosting plan."
type = string
default = "Standard"
validation {
condition = contains([
"Basic",
"Standard",
"ElasticPremium",
"Premium",
"PremiumV2",
"Premium0V3",
"PremiumV3",
"PremiumMV3",
"Isolated",
"IsolatedV2",
"WorkflowStandard",
"FlexConsumption"
], var.sku_tier)
error_message = "The sku_tier must be one of the allowed values."
}
}
variable "sku_name" {
description = "(Optional) Specifies the SKU name for the hosting plan."
type = string
default = "S1"
validation {
condition = contains([
"B1", "B2", "B3",
"S1", "S2", "S3",
"EP1", "EP2", "EP3",
"P1", "P2", "P3",
"P1V2", "P2V2", "P3V2",
"P0V3", "P1V3", "P2V3", "P3V3",
"P1MV3", "P2MV3", "P3MV3", "P4MV3", "P5MV3",
"I1", "I2", "I3",
"I1V2", "I2V2", "I3V2", "I4V2", "I5V2", "I6V2",
"WS1", "WS2", "WS3",
"FC1"
], var.sku_name)
error_message = "The sku_name must be one of the allowed values."
}
}
variable "use_dotnet_isolated_runtime" {
description = "(Optional) Should the DotNet process use an isolated runtime. Defaults to false."
type = bool
default = true
}
variable "java_version" {
description = "(Optional) The Version of Java to use."
type = string
default = null
}
variable "node_version" {
description = "(Optional) The version of Node.js to run."
type = string
default = null
}
variable "dotnet_version" {
description = "(Optional) The version of .NET to use."
type = string
default = null
}
variable "python_version" {
description = "(Optional) Specifies the version of Python to run. Possible values include 3.13, 3.12, 3.11, 3.10, 3.9, 3.8 and 3.7."
type = string
default = null
}
variable "https_only" {
description = "(Optional) Specifies whether the Linux Web App require HTTPS connections. Defaults to false."
type = bool
default = false
}
variable "minimum_tls_version" {
description = "(Optional) Specifies the minimum version of TLS required for SSL requests. Possible values include: 1.0, 1.1, 1.2 and 1.3. Defaults to 1.2."
type = string
default = "1.2"
validation {
condition = contains([
"1.0",
"1.1",
"1.2",
"1.3"
], var.minimum_tls_version)
error_message = "The minimum_tls_version must be one of the allowed values."
}
}
variable "always_on" {
description = "(Optional) Specifies whether the Linux Web App is Always On enabled. Defaults to true."
type = bool
default = true
}
variable "http2_enabled" {
description = "(Optional) Specifies whether HTTP/2 is enabled for the Linux Web App."
type = bool
default = false
}
variable "public_network_access_enabled" {
description = "(Optional) Specifies whether the public network access is enabled or disabled."
type = bool
default = true
}
variable "repo_url" {
description = "(Optional) Specifies the Git repository URL."
type = string
default = ""
validation {
condition = var.repo_url == "" || can(regex("^https?://", var.repo_url))
error_message = "The repo_url must be empty or a valid HTTP/HTTPS URL."
}
}
variable "login_name" {
description = "(Required) Specifies the login name for the application."
type = string
default = "paolo"
}
variable "tags" {
description = "(Optional) Specifies the tags to be applied to the resources."
type = map(string)
default = {
environment = "test"
deployment = "terraform"
}
}
variable "vnet_name" {
description = "Specifies the name of the virtual network."
default = "VNet"
type = string
}
variable "vnet_address_space" {
description = "Specifies the address space of the virtual network."
default = ["10.0.0.0/8"]
type = list(string)
}
variable "func_subnet_name" {
description = "Specifies the name of the web app subnet."
default = "app-subnet"
type = string
}
variable "func_subnet_address_prefix" {
description = "Specifies the address prefix of the web app subnet."
default = ["10.0.0.0/24"]
type = list(string)
}
variable "pe_subnet_name" {
description = "Specifies the name of the subnet that contains the private endpoints."
default = "pe-subnet"
type = string
}
variable "pe_subnet_address_prefix" {
description = "Specifies the address prefix of the subnet that contains the private endpoints."
default = ["10.0.1.0/24"]
type = list(string)
}
variable "nat_gateway_name" {
description = "(Required) Specifies the name of the NAT Gateway"
type = string
default = "NatGateway"
}
variable "nat_gateway_sku_name" {
description = "(Optional) The SKU which should be used. At this time the only supported value is Standard. Defaults to Standard"
type = string
default = "Standard"
}
variable "nat_gateway_idle_timeout_in_minutes" {
description = "(Optional) The idle timeout which should be used in minutes. Defaults to 4."
type = number
default = 4
}
variable "nat_gateway_zones" {
description = " (Optional) A list of Availability Zones in which this NAT Gateway should be located. Changing this forces a new NAT Gateway to be created."
type = list(string)
default = ["1"]
}
variable "website_port" {
description = "(Optional) Specifies the port on which the Web App will listen. Defaults to 8000."
type = number
default = 8000
}
variable "queue_names" {
description = "(Optional) Specifies the names of the queues to be created within the Service Bus Namespace."
type = set(string)
default = ["input", "output"]
}
variable "service_bus_sku" {
description = "(Required) Specifies the SKU tier for the Service Bus Namespace. Options are Basic, Standard, or Premium."
type = string
default = "Premium"
validation {
condition = contains(["Basic", "Standard", "Premium"], var.service_bus_sku)
error_message = "The SKU must be one of Basic, Standard, or Premium."
}
}
variable "service_bus_capacity" {
description = "(Optional) Specifies the capacity for the Service Bus Namespace. When SKU is Premium, capacity can be 1, 2, 4, 8, or 16. When SKU is Basic or Standard, capacity can be 0 only."
type = number
default = 1
}
variable "service_bus_premium_messaging_partitions" {
description = "(Optional) Specifies the number of messaging partitions. Only valid when SKU is Premium. Possible values include 1, 2, and 4. Defaults to 1."
type = number
default = 1
}
variable "service_bus_local_auth_enabled" {
description = "(Optional) Specifies whether SAS authentication is enabled for the Service Bus Namespace. Defaults to true."
type = bool
default = true
}
variable "service_bus_public_network_access_enabled" {
description = "(Optional) Specifies whether public network access is enabled for the Service Bus Namespace. Defaults to true."
type = bool
default = true
}
variable "queue_lock_duration" {
description = "(Optional) Specifies the ISO 8601 timespan duration of a peek-lock. Maximum value is 5 minutes. Defaults to PT5M."
type = string
default = "PT5M"
}
variable "queue_max_message_size_in_kilobytes" {
description = "(Optional) Specifies the maximum size of a message allowed on the queue in kilobytes. Only applicable for Premium SKU."
type = number
default = null
}
variable "queue_max_size_in_megabytes" {
description = "(Optional) Specifies the size of memory allocated for the queue in megabytes."
type = number
default = 1024
}
variable "queue_requires_duplicate_detection" {
description = "(Optional) Specifies whether the queue requires duplicate detection. Changing this forces a new resource to be created. Defaults to false."
type = bool
default = false
}
variable "queue_requires_session" {
description = "(Optional) Specifies whether the queue requires sessions for ordered handling of unbounded sequences of related messages. Changing this forces a new resource to be created. Defaults to false."
type = bool
default = false
}
variable "queue_default_message_ttl" {
description = "(Optional) Specifies the ISO 8601 timespan duration of the TTL of messages sent to this queue."
type = string
default = "P10675199DT2H48M5.4775807S"
}
variable "queue_dead_lettering_on_message_expiration" {
description = "(Optional) Specifies whether the queue has dead letter support when a message expires. Defaults to false."
type = bool
default = false
}
variable "queue_duplicate_detection_history_time_window" {
description = "(Optional) Specifies the ISO 8601 timespan duration during which duplicates can be detected. Defaults to PT10M."
type = string
default = "PT10M"
}
variable "queue_max_delivery_count" {
description = "(Optional) Specifies the maximum number of deliveries before a message is automatically dead lettered. Defaults to 10."
type = number
default = 10
}
variable "queue_status" {
description = "(Optional) Specifies the status of the queue. Possible values are Active, Creating, Deleting, Disabled, ReceiveDisabled, Renaming, SendDisabled, Unknown. Defaults to Active."
type = string
default = "Active"
}
variable "queue_batched_operations_enabled" {
description = "(Optional) Specifies whether server-side batched operations are enabled. Defaults to true."
type = bool
default = true
}
variable "queue_auto_delete_on_idle" {
description = "(Optional) Specifies the ISO 8601 timespan duration of the idle interval after which the queue is automatically deleted. Minimum of 5 minutes."
type = string
default = null
}
variable "queue_partitioning_enabled" {
description = "(Optional) Specifies whether the queue is partitioned across multiple message brokers. Changing this forces a new resource to be created. Defaults to false."
type = bool
default = false
}
variable "queue_express_enabled" {
description = "(Optional) Specifies whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage. Defaults to false."
type = bool
default = false
}
variable "queue_forward_to" {
description = "(Optional) Specifies the name of a queue or topic to automatically forward messages to."
type = string
default = null
}
variable "queue_forward_dead_lettered_messages_to" {
description = "(Optional) Specifies the name of a queue or topic to automatically forward dead lettered messages to."
type = string
default = null
}
variable "account_replication_type" {
description = "(Optional) Specifies the replication type for the storage account."
type = string
default = "LRS"
validation {
condition = contains([
"LRS",
"GRS",
"RAGRS",
"ZRS",
"GZRS",
"RAGZRS"
], var.account_replication_type)
error_message = "The account_replication_type must be one of: LRS, GRS, RAGRS, ZRS, GZRS, RAGZRS."
}
}
variable "account_kind" {
description = "(Optional) Specifies the account kind of the storage account."
default = "StorageV2"
type = string
validation {
condition = contains(["Storage", "StorageV2"], var.account_kind)
error_message = "The account kind of the storage account is invalid."
}
}
variable "account_tier" {
description = "(Optional) Specifies the account tier of the storage account."
default = "Standard"
type = string
validation {
condition = contains(["Standard", "Premium"], var.account_tier)
error_message = "The account tier of the storage account is invalid."
}
}
variable "functions_worker_runtime" {
description = "(Required) Specifies the language runtime used by the Azure Functions App."
type = string
default = "dotnet-isolated"
validation {
condition = contains(["dotnet", "dotnet-isolated", "python", "java", "node", "powerShell", "custom"], var.functions_worker_runtime)
error_message = "The functions_worker_runtime must be one of: dotnet, dotnet-isolated, python, java, node, powerShell, custom."
}
}
variable "functions_extension_version" {
description = "(Optional) Specifies the Azure Functions extension version. Defaults to ~4."
type = string
default = "~4"
}
variable "input_queue_name" {
description = "(Optional) Specifies the name of the input queue."
type = string
default = "input"
}
variable "output_queue_name" {
description = "(Optional) Specifies the name of the output queue."
type = string
default = "output"
}
variable "names" {
description = "(Optional) Specifies a comma-separated list of names to be used as part of the sample data in the Azure Function App."
type = string
default = "Paolo,John,Jane,Max,Mary,Leo,Mia,Anna,Lisa,Anastasia"
}
variable "timer_schedule" {
description = "(Optional) Specifies the CRON expression for the timer trigger."
type = string
default = "*/10 * * * * *"
}
variable "managed_identity_type" {
description = "(Optional) Specifies the type of managed identity."
type = string
default = "UserAssigned"
validation {
condition = contains(["SystemAssigned", "UserAssigned"], var.managed_identity_type)
error_message = "The managed identity type must be either SystemAssigned or UserAssigned."
}
}