-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathvariables.tf
More file actions
148 lines (120 loc) · 5.05 KB
/
variables.tf
File metadata and controls
148 lines (120 loc) · 5.05 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
variable "aad_tenant_id" {
type = string
description = "The Microsoft Entra tenant id."
validation {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", var.aad_tenant_id))
error_message = "Must be a valid GUID in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'."
}
}
variable "arm_client_id" {
type = string
description = "The AppId of the service principal used for authenticating with Azure. Must have an 'Owner' role assignment."
validation {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", var.arm_client_id))
error_message = "Must be a valid GUID in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'."
}
}
variable "arm_client_secret" {
type = string
description = "The password for the service principal used for authenticating with Azure. Set interactively or using an environment variable 'TF_VAR_arm_client_secret'."
sensitive = true
validation {
condition = length(var.arm_client_secret) >= 8
error_message = "Must be at least 8 characters long."
}
}
# variable "enable_module_ai_foundry" {
# type = bool
# description = "Set to true to enable the AI Foundry module, false to skip it."
# default = false
# }
variable "enable_module_avd" {
type = bool
description = "Set to true to enable the Azure Virtual Desktop (AVD) module, false to skip it."
default = false
}
variable "enable_module_mssql" {
type = bool
description = "Set to true to enable the Azure SQL Database (mssql) module, false to skip it."
default = false
}
variable "enable_module_mysql" {
type = bool
description = "Set to true to enable the Azure Database for MySQL (mysql) module, false to skip it."
default = false
}
variable "enable_module_petstore" {
type = bool
description = "Set to true to enable the petstore module, false to skip it."
default = false
}
variable "enable_module_vm_jumpbox_linux" {
type = bool
description = "Set to true to enable the vm_jumpbox_linux module, false to skip it."
default = false
}
variable "enable_module_vm_mssql_win" {
type = bool
description = "Set to true to enable the vm_mssql_win module, false to skip it."
default = false
}
variable "enable_module_vnet_app" {
type = bool
description = "Set to true to enable the vnet_app module, false to skip it."
default = false
}
variable "enable_module_vnet_onprem" {
type = bool
description = "Set to true to enable the vnet_onprem module, false to skip it."
default = false
}
variable "enable_module_vwan" {
type = bool
description = "Set to true to enable the vwan module, false to skip it."
default = false
}
variable "location" {
type = string
description = "The name of the Azure Region where resources will be provisioned."
validation {
condition = can(regex("^[a-z0-9-]+$", var.location))
error_message = "Must be a valid Azure region name. It should only contain lowercase letters, numbers, and dashes."
}
}
variable "subscription_id" {
type = string
description = "The Azure subscription id used to provision resources."
validation {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", var.subscription_id))
error_message = "Must be a valid GUID in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'."
}
}
variable "tags" {
type = map(any)
description = "The tags in map format to be used when creating new resources."
default = { costcenter = "mycostcenter", environment = "dev", project = "sand" }
validation {
condition = alltrue([
for key, value in var.tags :
can(regex("^[a-zA-Z0-9._-]{1,512}$", key)) &&
can(regex("^[a-zA-Z0-9._ -]{0,256}$", value))
])
error_message = "Each tag key must be 1-512 characters long and consist of alphanumeric characters, periods (.), underscores (_), or hyphens (-). Each tag value must be 0-256 characters long and consist of alphanumeric characters, periods (.), underscores (_), spaces, or hyphens (-)."
}
}
variable "user_name" {
type = string
description = "The user name of the user in Microsoft Entra ID."
validation {
condition = can(regex("^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9]\\.[a-zA-Z]{2,}$", var.user_name))
error_message = "Must be a valid User Principal Name (UPN) format like 'user@domain.com'. The username part must start and end with alphanumeric characters and can contain periods (.), underscores (_), or hyphens (-). The domain must be a valid domain name."
}
}
variable "user_object_id" {
type = string
description = "The object id of the user in Microsoft Entra ID."
validation {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", var.user_object_id))
error_message = "Must be a valid GUID in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'."
}
}