-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvariables.tf
More file actions
411 lines (374 loc) · 12.6 KB
/
variables.tf
File metadata and controls
411 lines (374 loc) · 12.6 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
variable "global_settings" {
description = "Global settings object"
type = object({
prefixes = optional(list(string))
random_length = optional(number)
passthrough = optional(bool)
use_slug = optional(bool)
tags = optional(map(string))
regions = optional(map(string)) # Ensure downstream modules accept this field
})
}
variable "resource_groups" {
description = "Resource groups configuration objects"
type = map(object({
name = string
region = string
tags = optional(map(string), {})
}))
default = {}
}
variable "dev_centers" {
description = "Dev Centers configuration objects"
type = map(object({
name = string
display_name = optional(string)
resource_group = object({
key = string
})
identity = optional(object({
type = string
identity_ids = optional(list(string))
}))
dev_box_provisioning_settings = optional(object({
install_azure_monitor_agent_enable_installation = optional(string)
}))
encryption = optional(object({
customer_managed_key_encryption = optional(object({
key_encryption_key_identity = optional(object({
identity_type = optional(string)
delegated_identity_client_id = optional(string)
user_assigned_identity_resource_id = optional(string)
}))
key_encryption_key_url = optional(string)
}))
}))
network_settings = optional(object({
microsoft_hosted_network_enable_status = optional(string)
}))
project_catalog_settings = optional(object({
catalog_item_sync_enable_status = optional(string)
}))
tags = optional(map(string), {})
}))
default = {}
}
#tflint-ignore: terraform_unused_declarations
variable "dev_center_galleries" {
description = "Dev Center Galleries configuration objects"
type = map(object({
name = string
dev_center_id = optional(string)
dev_center = optional(object({
key = string
}))
resource_group_name = optional(string)
resource_group = optional(object({
key = string
}))
gallery_resource_id = string
shared_gallery = optional(object({
key = string
}))
tags = optional(map(string), {})
}))
default = {}
}
variable "dev_center_dev_box_definitions" {
description = "Dev Center Dev Box Definitions configuration objects"
type = map(object({
name = string
dev_center = object({
key = string
})
resource_group = object({
key = string
})
# Image reference - supports both direct ID and object form
image_reference_id = optional(string)
image_reference = optional(object({
id = string
}))
# SKU configuration - supports both simple name and full object
sku_name = optional(string)
sku = optional(object({
name = string
capacity = optional(number)
family = optional(string)
size = optional(string)
tier = optional(string) # Free, Basic, Standard, Premium
}))
# OS Storage type for the Operating System disk
os_storage_type = optional(string)
# Hibernate support
hibernate_support = optional(bool, false)
# Tags
tags = optional(map(string), {})
}))
default = {}
}
variable "dev_center_projects" {
description = "Dev Center Projects configuration objects"
type = map(object({
name = string
dev_center_id = optional(string)
dev_center = optional(object({
key = string
}))
resource_group_name = optional(string)
resource_group = optional(object({
key = string
}))
resource_group_id = optional(string)
region = optional(string)
description = optional(string)
display_name = optional(string)
maximum_dev_boxes_per_user = optional(number)
dev_box_definition_names = optional(list(string), [])
# Managed Identity configuration
identity = optional(object({
type = string # "None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned"
identity_ids = optional(list(string), [])
}), {
type = "SystemAssigned"
})
# Azure AI Services Settings
azure_ai_services_settings = optional(object({
azure_ai_services_mode = optional(string, "Disabled") # "AutoDeploy", "Disabled"
}))
# Catalog Settings
catalog_settings = optional(object({
catalog_item_sync_types = optional(list(string), []) # "EnvironmentDefinition", "ImageDefinition"
}))
# Customization Settings
customization_settings = optional(object({
user_customizations_enable_status = optional(string, "Disabled") # "Enabled", "Disabled"
identities = optional(list(object({
identity_resource_id = optional(string)
identity_type = optional(string) # "systemAssignedIdentity", "userAssignedIdentity"
})), [])
}))
# Dev Box Auto Delete Settings
dev_box_auto_delete_settings = optional(object({
delete_mode = optional(string, "Manual") # "Auto", "Manual"
grace_period = optional(string) # ISO8601 duration format PT[n]H[n]M[n]S
inactive_threshold = optional(string) # ISO8601 duration format PT[n]H[n]M[n]S
}))
# Serverless GPU Sessions Settings
serverless_gpu_sessions_settings = optional(object({
max_concurrent_sessions_per_project = optional(number)
serverless_gpu_sessions_mode = optional(string, "Disabled") # "AutoDeploy", "Disabled"
}))
# Workspace Storage Settings
workspace_storage_settings = optional(object({
workspace_storage_mode = optional(string, "Disabled") # "AutoDeploy", "Disabled"
}))
tags = optional(map(string), {})
}))
default = {}
}
variable "dev_center_catalogs" {
description = "Dev Center Catalogs configuration objects"
type = map(object({
name = string
dev_center_id = optional(string)
dev_center = optional(object({
key = string
}))
# GitHub catalog configuration
github = optional(object({
branch = string
uri = string
path = optional(string)
secret_identifier = optional(string)
}))
# Azure DevOps Git catalog configuration
ado_git = optional(object({
branch = string
uri = string
path = optional(string)
secret_identifier = optional(string)
}))
# Sync type: Manual or Scheduled
sync_type = optional(string)
# Resource-specific tags (separate from infrastructure tags)
resource_tags = optional(map(string))
tags = optional(map(string), {})
}))
default = {}
validation {
condition = alltrue([
for k, v in var.dev_center_catalogs : (
(try(v.github, null) != null && try(v.ado_git, null) == null) ||
(try(v.github, null) == null && try(v.ado_git, null) != null)
)
])
error_message = "Each catalog must specify exactly one of 'github' or 'ado_git', but not both."
}
validation {
condition = alltrue([
for k, v in var.dev_center_catalogs :
try(v.sync_type, null) == null ? true : contains(["Manual", "Scheduled"], v.sync_type)
])
error_message = "sync_type must be either 'Manual' or 'Scheduled'."
}
}
variable "dev_center_environment_types" {
description = "Dev Center Environment Types configuration objects"
type = map(object({
name = string
display_name = optional(string)
dev_center_id = optional(string)
dev_center = optional(object({
key = string
}))
tags = optional(map(string), {})
}))
default = {}
}
# tflint-ignore: terraform_unused_declarations
variable "dev_center_network_connections" {
description = "Dev Center Network Connections configuration objects"
type = map(object({
name = string
domain_join_type = string
subnet_id = string
dev_center_id = optional(string)
dev_center = optional(object({
key = string
}))
resource_group = optional(object({
key = string
}))
domain_join = optional(object({
domain_name = string
domain_password_secret_id = optional(string)
domain_username = string
organizational_unit_path = optional(string)
}))
networking_resource_group_name = optional(string)
tags = optional(map(string), {})
}))
default = {}
validation {
condition = alltrue([
for k, v in var.dev_center_network_connections :
contains(["AzureADJoin", "HybridAzureADJoin", "None"], v.domain_join_type)
])
error_message = "Domain join type must be one of: AzureADJoin, HybridAzureADJoin, None."
}
}
# tflint-ignore: terraform_unused_declarations
variable "shared_image_galleries" {
description = "Shared Image Galleries configuration objects"
type = map(object({
name = string
description = optional(string)
location = optional(string)
resource_group_name = optional(string)
resource_group = optional(object({
key = string
}))
sharing = optional(object({
permission = string
}))
tags = optional(map(string), {})
}))
default = {}
}
variable "dev_center_project_pools" {
description = "DevCenter Project Pools configuration objects"
type = map(object({
name = string
display_name = optional(string)
dev_box_definition_name = string
dev_center_project_id = optional(string)
dev_center_project = optional(object({
key = string
}))
resource_group_id = optional(string)
resource_group = optional(object({
key = string
}))
region = optional(string)
local_administrator_enabled = optional(bool, false)
network_connection_name = optional(string, "default")
stop_on_disconnect_grace_period_minutes = optional(number, 60)
license_type = optional(string, "Windows_Client")
virtual_network_type = optional(string, "Managed")
single_sign_on_status = optional(string, "Disabled")
tags = optional(map(string), {})
}))
default = {}
validation {
condition = alltrue([
for pool_key, pool in var.dev_center_project_pools :
pool.stop_on_disconnect_grace_period_minutes >= 60 && pool.stop_on_disconnect_grace_period_minutes <= 480
])
error_message = "Stop on disconnect grace period must be between 60 and 480 minutes for all pools."
}
}
variable "dev_center_project_pool_schedules" {
description = "DevCenter Project Pool Schedules configuration objects"
type = map(object({
dev_center_project_pool_id = optional(string)
dev_center_project_pool = optional(object({
key = string
}))
schedule = object({
name = string
type = optional(string, "StopDevBox")
frequency = optional(string, "Daily")
time = string
time_zone = string
state = optional(string, "Enabled")
tags = optional(map(string), {})
})
}))
default = {}
}
variable "dev_center_project_environment_types" {
description = "Dev Center Project Environment Types configuration objects"
type = map(object({
name = string
project = object({
key = string
})
environment_type = object({
key = string
})
dev_center_project_id = optional(string)
deployment_target_id = optional(string)
status = optional(string, "Enabled")
user_role_assignments = optional(map(object({
roles = map(object({}))
})))
tags = optional(map(string), {})
}))
default = {}
validation {
condition = alltrue([
for k, v in var.dev_center_project_environment_types : (
(v.dev_center_project_id != null && v.project == null) ||
(v.dev_center_project_id == null && v.project != null)
)
])
error_message = "Either 'dev_center_project_id' or 'project.key' must be specified, but not both."
}
validation {
condition = alltrue([
for k, v in var.dev_center_project_environment_types : (
(v.deployment_target_id != null && v.environment_type == null) ||
(v.deployment_target_id == null && v.environment_type != null)
)
])
error_message = "Either 'deployment_target_id' or 'environment_type.key' must be specified, but not both."
}
validation {
condition = alltrue([
for k, v in var.dev_center_project_environment_types :
contains(["Enabled", "Disabled"], v.status)
])
error_message = "Status must be either 'Enabled' or 'Disabled'."
}
}