-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvariables.tf
312 lines (271 loc) · 10.5 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
variable "location" {
description = "Azure location."
type = string
}
variable "location_short" {
description = "Short string for Azure location."
type = string
}
variable "client_name" {
description = "Client name/account used in naming"
type = string
}
variable "environment" {
description = "Project environment"
type = string
}
variable "stack" {
description = "Project stack name"
type = string
}
variable "resource_group_name" {
description = "Resource group name"
type = string
}
variable "app_settings" {
description = "Application settings for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#app_settings"
type = map(string)
default = {}
}
variable "site_config" {
description = "Site config for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#site_config. IP restriction attribute is no more managed in this block."
type = any
default = {}
}
variable "connection_strings" {
description = "Connection strings for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#connection_string"
type = list(map(string))
default = []
}
variable "sticky_settings" {
description = "Lists of connection strings and app settings to prevent from swapping between slots."
type = object({
app_setting_names = optional(list(string))
connection_string_names = optional(list(string))
})
default = null
}
variable "authorized_ips" {
description = "IPs restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#ip_restriction"
type = list(string)
default = []
}
variable "public_network_access_enabled" {
description = "Whether enable public access for the App Service."
type = bool
default = false
}
variable "authorized_subnet_ids" {
description = "Subnets restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#ip_restriction"
type = list(string)
default = []
}
variable "authorized_service_tags" {
description = "Service Tags restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#ip_restriction"
type = list(string)
default = []
}
variable "ip_restriction_headers" {
description = "IPs restriction headers for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#headers"
type = map(list(string))
default = null
}
variable "scm_authorized_ips" {
description = "SCM IPs restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#scm_ip_restriction"
type = list(string)
default = []
}
variable "scm_authorized_subnet_ids" {
description = "SCM subnets restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#scm_ip_restriction"
type = list(string)
default = []
}
variable "scm_authorized_service_tags" {
description = "SCM Service Tags restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#scm_ip_restriction"
type = list(string)
default = []
}
variable "scm_ip_restriction_headers" {
description = "IPs restriction headers for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#headers"
type = map(list(string))
default = null
}
variable "client_affinity_enabled" {
description = "Client affinity activation for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#client_affinity_enabled"
type = bool
default = false
}
variable "https_only" {
description = "HTTPS restriction for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#https_only"
type = bool
default = false
}
variable "client_certificate_enabled" {
description = "Client certificate activation for App Service. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service.html#client_certificate_enabled"
type = bool
default = false
}
# Backup options
variable "backup_enabled" {
description = "`true` to enable App Service backup"
type = bool
default = false
}
variable "backup_frequency_interval" {
description = "Frequency interval for the App Service backup."
type = number
default = 1
}
variable "backup_retention_period_in_days" {
description = "Retention in days for the App Service backup."
type = number
default = 30
}
variable "backup_frequency_unit" {
description = "Frequency unit for the App Service backup. Possible values are `Day` or `Hour`."
type = string
default = "Day"
}
variable "backup_keep_at_least_one_backup" {
description = "Should the service keep at least one backup, regardless of age of backup."
type = bool
default = true
}
variable "backup_storage_account_connection_string" {
description = "Storage account connection string to use if App Service backup is enabled."
type = string
default = null
}
variable "backup_storage_account_container" {
description = "Name of the container in the Storage Account if App Service backup is enabled"
type = string
default = "webapps"
}
variable "mount_points" {
description = "Storage Account mount points. Name is generated if not set and default type is `AzureFiles`. See https://www.terraform.io/docs/providers/azurerm/r/app_service.html#storage_account"
type = list(object({
name = optional(string)
type = optional(string, "AzureFiles")
account_name = string
share_name = string
access_key = string
mount_path = optional(string)
}))
validation {
condition = alltrue([for m in var.mount_points : contains(["AzureBlob", "AzureFiles"], m.type)])
error_message = "The `type` attribute of `var.mount_points` object list must be `AzureBlob` or `AzureFiles`."
}
default = []
nullable = false
}
variable "staging_slot_mount_points" {
description = "Storage Account mount points for Staging slot. Name is generated if not set and default type is `AzureFiles`. See https://www.terraform.io/docs/providers/azurerm/r/app_service.html#storage_account"
type = list(object({
name = optional(string)
type = optional(string, "AzureFiles")
account_name = string
share_name = string
access_key = string
mount_path = optional(string)
}))
validation {
condition = alltrue([for m in var.staging_slot_mount_points : contains(["AzureBlob", "AzureFiles"], m.type)])
error_message = "The `type` attribute of `var.staging_slot_mount_points` object list must be `AzureBlob` or `AzureFiles`."
}
default = []
nullable = false
}
variable "auth_settings" {
description = "Authentication settings. Issuer URL is generated thanks to the tenant ID. For active_directory block, the allowed_audiences list is filled with a value generated with the name of the App Service. See https://www.terraform.io/docs/providers/azurerm/r/app_service.html#auth_settings"
type = any
default = {}
}
variable "auth_settings_v2" {
description = "Authentication settings V2. See https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app#auth_settings_v2"
type = any
default = {}
}
variable "custom_domains" {
description = <<EOD
Custom domains and SSL certificates of the App Service. Could declare a custom domain with SSL binding. SSL certificate could be provided from an Azure Keyvault Certificate Secret or from a file with following attributes :
```
- certificate_name: Name of the stored certificate.
- certificate_keyvault_certificate_id: ID of the Azure Keyvault Certificate Secret.
```
EOD
type = map(object({
certificate_name = optional(string)
certificate_keyvault_certificate_id = optional(string)
certificate_thumbprint = optional(string)
}))
default = null
}
variable "certificates" {
description = "Certificates for custom domains"
type = map(map(string))
default = {}
}
variable "app_service_vnet_integration_subnet_id" {
description = "Id of the subnet to associate with the app service"
type = string
default = null
}
variable "staging_slot_enabled" {
type = bool
description = "Create a staging slot alongside the app service for blue/green deployment purposes. See documentation https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_slot"
default = true
}
variable "staging_slot_custom_app_settings" {
type = map(string)
description = "Override staging slot with custom app settings"
default = null
}
variable "docker_image" {
description = "Docker image to use for this App Service"
type = object({
registry = string
name = string
tag = string
registry_username = optional(string)
registry_password = optional(string)
slot_tag = optional(string)
})
default = null
}
variable "app_service_logs" {
description = "Configuration of the App Service and App Service Slot logs. [Linux](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app#logs) and [Windows](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app#logs) documentation."
type = object({
detailed_error_messages = optional(bool)
failed_request_tracing = optional(bool)
application_logs = optional(object({
file_system_level = string
azure_blob_storage = optional(object({
level = string
retention_in_days = number
sas_url = string
}))
}))
http_logs = optional(object({
azure_blob_storage = optional(object({
retention_in_days = number
sas_url = string
}))
file_system = optional(object({
retention_in_days = number
retention_in_mb = number
}))
}))
})
default = null
}
variable "identity" {
description = "Map with identity block information."
type = object({
type = string
identity_ids = list(string)
})
default = {
type = "SystemAssigned"
identity_ids = []
}
}