generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathvariables.tf
466 lines (419 loc) · 23.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
variable "kind" {
type = string
description = "(Optional) Specifies the type of Cognitive Service Account that should be created. Possible values are `Academic`, `AIServices`, `AnomalyDetector`, `Bing.Autosuggest`, `Bing.Autosuggest.v7`, `Bing.CustomSearch`, `Bing.Search`, `Bing.Search.v7`, `Bing.Speech`, `Bing.SpellCheck`, `Bing.SpellCheck.v7`, `CognitiveServices`, `ComputerVision`, `ContentModerator`, `ContentSafety`, `CustomSpeech`, `CustomVision.Prediction`, `CustomVision.Training`, `Emotion`, `Face`, `FormRecognizer`, `ImmersiveReader`, `LUIS`, `LUIS.Authoring`, `MetricsAdvisor`, `OpenAI`, `Personalizer`, `QnAMaker`, `Recommendations`, `SpeakerRecognition`, `Speech`, `SpeechServices`, `SpeechTranslation`, `TextAnalytics`, `TextTranslation` and `WebLM`. Changing this forces a new resource to be created."
nullable = false
}
variable "location" {
type = string
description = "(Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created."
nullable = false
}
variable "name" {
type = string
description = "(Required) Specifies the name of the Cognitive Service or AI Service Account. Changing this forces a new resource to be created."
nullable = false
}
variable "resource_group_name" {
type = string
description = "(Required) The name of the resource group in which the Cognitive Service or AI Service Account is created. Changing this forces a new resource to be created."
nullable = false
}
variable "sku_name" {
type = string
description = "(Required) Specifies the SKU Name for this Cognitive Service or AI Service Account. Possible values are `F0`, `F1`, `S0`, `S`, `S1`, `S2`, `S3`, `S4`, `S5`, `S6`, `P0`, `P1`, `P2`, `E0` and `DC0`."
nullable = false
}
variable "cognitive_deployments" {
type = map(object({
name = string
rai_policy_name = optional(string)
version_upgrade_option = optional(string)
model = object({
format = string
name = string
version = optional(string)
})
scale = object({
capacity = optional(number)
family = optional(string)
size = optional(string)
tier = optional(string)
type = string
})
timeouts = optional(object({
create = optional(string)
delete = optional(string)
read = optional(string)
update = optional(string)
}))
}))
default = {}
description = <<-DESCRIPTION
- `name` - (Required) The name of the Cognitive Services Account Deployment. Changing this forces a new resource to be created.
- `rai_policy_name` - (Optional) The name of RAI policy.
- `version_upgrade_option` - (Optional) Deployment model version upgrade option. Possible values are `OnceNewDefaultVersionAvailable`, `OnceCurrentVersionExpired`, and `NoAutoUpgrade`. Defaults to `OnceNewDefaultVersionAvailable`. Changing this forces a new resource to be created.
---
`model` block supports the following:
- `format` - (Required) The format of the Cognitive Services Account Deployment model. Changing this forces a new resource to be created. Possible value is `OpenAI`.
- `name` - (Required) The name of the Cognitive Services Account Deployment model. Changing this forces a new resource to be created.
- `version` - (Optional) The version of Cognitive Services Account Deployment model. If `version` is not specified, the default version of the model at the time will be assigned.
---
`scale` block supports the following:
- `capacity` - (Optional) Tokens-per-Minute (TPM). The unit of measure for this field is in the thousands of Tokens-per-Minute. Defaults to `1` which means that the limitation is `1000` tokens per minute. If the resources SKU supports scale in/out then the capacity field should be included in the resources' configuration. If the scale in/out is not supported by the resources SKU then this field can be safely omitted. For more information about TPM please see the [product documentation](https://learn.microsoft.com/azure/ai-services/openai/how-to/quota?tabs=rest).
- `family` - (Optional) If the service has different generations of hardware, for the same SKU, then that can be captured here. Changing this forces a new resource to be created.
- `size` - (Optional) The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. Changing this forces a new resource to be created.
- `tier` - (Optional) Possible values are `Free`, `Basic`, `Standard`, `Premium`, `Enterprise`. Changing this forces a new resource to be created.
- `type` - (Required) The name of the SKU. Ex
---
`timeouts` block supports the following:
- `create` - (Defaults to 30 minutes) Used when creating the Cognitive Services Account Deployment.
- `delete` - (Defaults to 30 minutes) Used when deleting the Cognitive Services Account Deployment.
- `read` - (Defaults to 5 minutes) Used when retrieving the Cognitive Services Account Deployment.
- `update` - (Defaults to 30 minutes) Used when updating the Cognitive Services Account Deployment.
DESCRIPTION
nullable = false
}
variable "custom_question_answering_search_service_id" {
type = string
default = null
description = "(Optional) If `kind` is `TextAnalytics` this specifies the ID of the Search service."
}
variable "custom_question_answering_search_service_key" {
type = string
default = null
description = "(Optional) If `kind` is `TextAnalytics` this specifies the key of the Search service."
sensitive = true
}
variable "custom_subdomain_name" {
type = string
default = null
description = "(Optional) The subdomain name used for token-based authentication. This property is required when `network_acls` is specified. Changing this forces a new resource to be created."
}
variable "customer_managed_key" {
type = object({
key_vault_resource_id = string
key_name = string
key_version = optional(string, null)
user_assigned_identity = optional(object({
resource_id = string
}), null)
})
default = null
description = <<DESCRIPTION
Controls the Customer managed key configuration on this resource. The following properties can be specified:
- `key_vault_resource_id` - (Required) Resource ID of the Key Vault that the customer managed key belongs to.
- `key_name` - (Required) Specifies the name of the Customer Managed Key Vault Key.
- `key_version` - (Optional) The version of the Customer Managed Key Vault Key.
- `user_assigned_identity` - (Optional) The User Assigned Identity that has access to the key.
- `resource_id` - (Required) The resource ID of the User Assigned Identity that has access to the key.
DESCRIPTION
}
variable "diagnostic_settings" {
type = map(object({
name = optional(string, null)
log_categories = optional(set(string), [])
log_groups = optional(set(string), ["allLogs"])
metric_categories = optional(set(string), ["AllMetrics"])
log_analytics_destination_type = optional(string, "Dedicated")
workspace_resource_id = optional(string, null)
storage_account_resource_id = optional(string, null)
event_hub_authorization_rule_resource_id = optional(string, null)
event_hub_name = optional(string, null)
marketplace_partner_resource_id = optional(string, null)
}))
default = {}
description = <<DESCRIPTION
A map of diagnostic settings to create on the Cognitive Account. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
- `name` - (Optional) The name of the diagnostic setting. One will be generated if not set, however this will not be unique if you want to create multiple diagnostic setting resources.
- `log_categories` - (Optional) A set of log categories to send to the log analytics workspace. Defaults to `[]`.
- `log_groups` - (Optional) A set of log groups to send to the log analytics workspace. Defaults to `["allLogs"]`.
- `metric_categories` - (Optional) A set of metric categories to send to the log analytics workspace. Defaults to `["AllMetrics"]`.
- `log_analytics_destination_type` - (Optional) The destination type for the diagnostic setting. Possible values are `Dedicated` and `AzureDiagnostics`. Defaults to `Dedicated`.
- `workspace_resource_id` - (Optional) The resource ID of the log analytics workspace to send logs and metrics to.
- `storage_account_resource_id` - (Optional) The resource ID of the storage account to send logs and metrics to.
- `event_hub_authorization_rule_resource_id` - (Optional) The resource ID of the event hub authorization rule to send logs and metrics to.
- `event_hub_name` - (Optional) The name of the event hub. If none is specified, the default event hub will be selected.
- `marketplace_partner_resource_id` - (Optional) The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic LogsLogs.
DESCRIPTION
nullable = false
validation {
condition = alltrue([for _, v in var.diagnostic_settings : contains(["Dedicated", "AzureDiagnostics"], v.log_analytics_destination_type)])
error_message = "Log analytics destination type must be one of: 'Dedicated', 'AzureDiagnostics'."
}
validation {
condition = alltrue(
[
for _, v in var.diagnostic_settings :
v.workspace_resource_id != null || v.storage_account_resource_id != null || v.event_hub_authorization_rule_resource_id != null || v.marketplace_partner_resource_id != null
]
)
error_message = "At least one of `workspace_resource_id`, `storage_account_resource_id`, `marketplace_partner_resource_id`, or `event_hub_authorization_rule_resource_id`, must be set."
}
}
variable "dynamic_throttling_enabled" {
type = bool
default = null
description = "(Optional) Whether to enable the dynamic throttling for this Cognitive Service Account."
}
variable "enable_telemetry" {
type = bool
default = true
description = <<DESCRIPTION
This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.
DESCRIPTION
}
variable "fqdns" {
type = list(string)
default = null
description = "(Optional) List of FQDNs allowed for the Cognitive Account."
}
variable "is_hsm_key" {
type = bool
default = false
description = "(Optional) Describes whether the Cognitive Account is using a Hardware Security Module (HSM) for encryption. Defaults to `false`."
nullable = false
}
variable "local_auth_enabled" {
type = bool
default = null
description = "(Optional) Whether local authentication methods is enabled for the Cognitive Account. Defaults to `true`."
}
variable "lock" {
type = object({
kind = string
name = optional(string, null)
})
default = null
description = <<DESCRIPTION
Controls the Resource Lock configuration for this resource. The following properties can be specified:
- `kind` - (Required) The type of lock. Possible values are `\"CanNotDelete\"` and `\"ReadOnly\"`.
- `name` - (Optional) The name of the lock. If not specified, a name will be generated based on the `kind` value. Changing this forces the creation of a new resource.
DESCRIPTION
validation {
condition = var.lock != null ? contains(["CanNotDelete", "ReadOnly"], var.lock.kind) : true
error_message = "Lock kind must be either `\"CanNotDelete\"` or `\"ReadOnly\"`."
}
}
variable "managed_identities" {
type = object({
system_assigned = optional(bool, false)
user_assigned_resource_ids = optional(set(string), [])
})
default = {}
description = <<DESCRIPTION
Controls the Managed Identity configuration on this resource. The following properties can be specified:
- `system_assigned` - (Optional) Specifies if the System Assigned Managed Identity should be enabled.
- `user_assigned_resource_ids` - (Optional) Specifies a list of User Assigned Managed Identity resource IDs to be assigned to this resource.
DESCRIPTION
nullable = false
}
variable "metrics_advisor_aad_client_id" {
type = string
default = null
description = "(Optional) The Azure AD Client ID (Application ID). This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created."
}
variable "metrics_advisor_aad_tenant_id" {
type = string
default = null
description = "(Optional) The Azure AD Tenant ID. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created."
}
variable "metrics_advisor_super_user_name" {
type = string
default = null
description = "(Optional) The super user of Metrics Advisor. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created."
}
variable "metrics_advisor_website_name" {
type = string
default = null
description = "(Optional) The website name of Metrics Advisor. This attribute is only set when kind is `MetricsAdvisor`. Changing this forces a new resource to be created."
}
variable "network_acls" {
type = object({
default_action = string
ip_rules = optional(set(string))
virtual_network_rules = optional(set(object({
ignore_missing_vnet_service_endpoint = optional(bool)
subnet_id = string
})))
})
default = null
description = <<-DESCRIPTION
- `default_action` - (Required) The Default Action to use when no rules match from `ip_rules` / `virtual_network_rules`. Possible values are `Allow` and `Deny`.
- `ip_rules` - (Optional) One or more IP Addresses, or CIDR Blocks which should be able to access the Cognitive Account.
---
`virtual_network_rules` block supports the following:
- `ignore_missing_vnet_service_endpoint` - (Optional) Whether ignore missing vnet service endpoint or not. Default to `false`.
- `subnet_id` - (Required) The ID of the subnet which should be able to access this Cognitive Account.
DESCRIPTION
}
variable "outbound_network_access_restricted" {
type = bool
default = null
description = "(Optional) Whether outbound network access is restricted for the Cognitive Account. Defaults to `false`."
}
variable "private_endpoints" {
type = map(object({
name = optional(string, null)
role_assignments = optional(map(object({
role_definition_id_or_name = string
principal_id = string
description = optional(string, null)
skip_service_principal_aad_check = optional(bool, false)
condition = optional(string, null)
condition_version = optional(string, null)
delegated_managed_identity_resource_id = optional(string, null)
principal_type = optional(string, null)
})), {})
lock = optional(object({
kind = string
name = optional(string, null)
}), null)
tags = optional(map(string), null)
subnet_resource_id = string
private_dns_zone_group_name = optional(string, "default")
private_dns_zone_resource_ids = optional(set(string), [])
application_security_group_associations = optional(map(string), {})
private_service_connection_name = optional(string, null)
network_interface_name = optional(string, null)
location = optional(string, null)
resource_group_name = optional(string, null)
ip_configurations = optional(map(object({
name = string
private_ip_address = string
})), {})
}))
default = {}
description = <<DESCRIPTION
A map of private endpoints to create on the Cognitive Service Account.
- `name` - (Optional) The name of the private endpoint. One will be generated if not set.
- `role_assignments` - (Optional) A map of role assignments to create on the private endpoint. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time. See `var.role_assignments` for more information.
- `lock` - (Optional) The lock level to apply to the private endpoint. Default is `None`. Possible values are `None`, `CanNotDelete`, and `ReadOnly`.
- `tags` - (Optional) A mapping of tags to assign to the private endpoint.
- `subnet_resource_id` - The resource ID of the subnet to deploy the private endpoint in.
- `private_dns_zone_group_name` - (Optional) The name of the private DNS zone group. One will be generated if not set.
- `private_dns_zone_resource_ids` - (Optional) A set of resource IDs of private DNS zones to associate with the private endpoint. If not set, no zone groups will be created and the private endpoint will not be associated with any private DNS zones. DNS records must be managed external to this module.
- `application_security_group_resource_ids` - (Optional) A map of resource IDs of application security groups to associate with the private endpoint. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
- `private_service_connection_name` - (Optional) The name of the private service connection. One will be generated if not set.
- `network_interface_name` - (Optional) The name of the network interface. One will be generated if not set.
- `location` - (Optional) The Azure location where the resources will be deployed. Defaults to the location of the resource group.
- `resource_group_name` - (Optional) The resource group where the resources will be deployed. Defaults to the resource group of the Cognitive Services Account.
- `ip_configurations` - (Optional) A map of IP configurations to create on the private endpoint. If not specified the platform will create one. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
- `name` - The name of the IP configuration.
- `private_ip_address` - The private IP address of the IP configuration.
DESCRIPTION
nullable = false
}
variable "private_endpoints_manage_dns_zone_group" {
type = bool
default = true
description = "Whether to manage private DNS zone groups with this module. If set to false, you must manage private DNS zone groups externally, e.g. using Azure Policy."
nullable = false
}
variable "public_network_access_enabled" {
type = bool
default = true
description = "(Optional) Whether public network access is allowed for the Cognitive Account. Defaults to `true`."
nullable = false
}
variable "qna_runtime_endpoint" {
type = string
default = null
description = "(Optional) A URL to link a QnAMaker cognitive account to a QnA runtime."
}
variable "rai_policies" {
type = map(object({
name = string
base_policy_name = string
mode = string
content_filters = optional(list(object({
blocking = bool
enabled = bool
name = string
severity_threshold = string
source = string
})))
custom_block_lists = optional(list(object({
source = string
block_list_name = string
blocking = bool
})))
}))
default = {}
description = <<-DESCRIPTION
- `name` - (Required) The name of the RAI policy. Changing this forces a new resource to be created.
- `base_policy_name` - (Required) The name of the base policy. Changing this forces a new resource to be created.
- `mode` - Rai policy mode. The enum value mapping is as below: `Default`, `Deferred`, `Blocking`, `Asynchronous_filter`. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version.
---
`content_filters` block supports the following:
- `name` - (Required) Name of ContentFilter.
- `enabled` - (Required) If the ContentFilter is enabled.
- `severity_threshold` - (Required) Level at which content is filtered. Possible values are `Low`, `Medium`, `High`.
- `blocking` - (Required) If blocking would occur.
- `source` - (Required) Content source to apply the Content Filters. Possible values are `Prompt`, `Completion`.
---
`custom_block_lists` block supports the following:
- `source` - (Required) Content source to apply the Custom Block Lists. Possible values are `Prompt`, `Completion`.
- `block_list_name` - (Required) Name of ContentFilter.
- `blocking` - (Required) If blocking would occur.
DESCRIPTION
nullable = false
}
variable "role_assignments" {
type = map(object({
role_definition_id_or_name = string
principal_id = string
description = optional(string, null)
skip_service_principal_aad_check = optional(bool, false)
condition = optional(string, null)
condition_version = optional(string, null)
delegated_managed_identity_resource_id = optional(string, null)
principal_type = optional(string, null)
}))
default = {}
description = <<DESCRIPTION
A map of role assignments to create on the <RESOURCE>. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
- `role_definition_id_or_name` - The ID or name of the role definition to assign to the principal.
- `principal_id` - The ID of the principal to assign the role to.
- `description` - (Optional) The description of the role assignment.
- `skip_service_principal_aad_check` - (Optional) If set to true, skips the Azure Active Directory check for the service principal in the tenant. Defaults to false.
- `condition` - (Optional) The condition which will be used to scope the role assignment.
- `condition_version` - (Optional) The version of the condition syntax. Leave as `null` if you are not using a condition, if you are then valid values are '2.0'.
- `delegated_managed_identity_resource_id` - (Optional) The delegated Azure Resource Id which contains a Managed Identity. Changing this forces a new resource to be created. This field is only used in cross-tenant scenario.
- `principal_type` - (Optional) The type of the `principal_id`. Possible values are `User`, `Group` and `ServicePrincipal`. It is necessary to explicitly set this attribute when creating role assignments if the principal creating the assignment is constrained by ABAC rules that filters on the PrincipalType attribute.
> Note: only set `skip_service_principal_aad_check` to true if you are assigning a role to a service principal.
DESCRIPTION
nullable = false
}
variable "storage" {
type = list(object({
identity_client_id = optional(string)
storage_account_id = string
}))
default = null
description = <<-DESCRIPTION
- `identity_client_id` - (Optional) The client ID of the managed identity associated with the storage resource.
- `storage_account_id` - (Required) Full resource id of a Microsoft.Storage resource.
DESCRIPTION
}
variable "tags" {
type = map(string)
default = null
description = "(Optional) A mapping of tags to assign to the resource."
}
variable "timeouts" {
type = object({
create = optional(string)
delete = optional(string)
read = optional(string)
update = optional(string)
})
default = null
description = <<-DESCRIPTION
- `create` - (Defaults to 30 minutes) Used when creating the Cognitive Service or AI Service Account.
- `delete` - (Defaults to 30 minutes) Used when deleting the Cognitive Service or AI Service Account.
- `read` - (Defaults to 5 minutes) Used when retrieving the Cognitive Service or AI Service Account.
- `update` - (Defaults to 30 minutes) Used when updating the Cognitive Service or AI Service Account.
DESCRIPTION
}