generated from getindata/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
variables.tf
448 lines (426 loc) · 16.1 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
variable "resource_group_name" {
description = "Azure resource group name where resources will be deployed"
type = string
}
variable "location" {
description = "Location where resources will be deployed. If not provided it will be read from resource group location"
type = string
default = null
}
variable "descriptor_name" {
description = "Name of the descriptor used to form a resource name"
type = string
default = "azure-container-group"
}
variable "diagnostic_settings" {
description = "Enables diagnostics settings for a resource and streams the logs and metrics to any provided sinks"
type = object({
enabled = optional(bool, false)
logs_destinations_ids = optional(list(string), [])
})
default = {}
}
variable "atlantis_container" {
description = "Atlantis container configuration. First item of the ports list must refer to the Atlantis"
type = object({
image = optional(string, "ghcr.io/runatlantis/atlantis")
cpu = optional(number, 1)
memory = optional(number, 1)
ports = optional(list(object({
port = number
protocol = optional(string, "TCP")
})), [{
port = 4141
protocol = "TCP"
}])
commands = optional(list(string), ["atlantis", "server"])
environment_variables = optional(map(string), {})
secure_environment_variables = optional(map(string), {})
secure_environment_variables_from_key_vault = optional(map(object({
key_vault_id = string
name = string
})), {})
volumes = optional(map(object({
mount_path = string
read_only = optional(bool, false)
empty_dir = optional(bool)
git_repo = optional(object({
url = string
directory = optional(string)
revision = optional(string)
}))
secret = optional(map(string))
secret_from_key_vault = optional(map(object({
key_vault_id = string
name = string
})), {})
storage_account_name = optional(string)
storage_account_key = optional(string)
share_name = optional(string)
})), {})
})
default = {}
}
variable "atlantis_server_config" {
description = "Atlantis server config. If any option is not available here, it can be passed by `environment_variables` variable"
type = object({
allow_draft_prs = optional(string)
allow_fork_prs = optional(string)
allow_repo_config = optional(string)
atlantis_url = optional(string)
automerge = optional(string)
autoplan_file_list = optional(string)
autoplan_modules = optional(string)
autoplan_modules_from_projects = optional(string)
azuredevops_hostname = optional(string)
azuredevops_webhook_password = optional(string)
azuredevops_webhook_user = optional(string)
azuredevops_token = optional(string)
azuredevops_user = optional(string)
bitbucket_base_url = optional(string)
bitbucket_token = optional(string)
bitbucket_user = optional(string)
bitbucket_webhook_secret = optional(string)
checkout_strategy = optional(string)
config = optional(string)
data_dir = optional(string)
default_tf_version = optional(string)
disable_apply = optional(string)
disable_apply_all = optional(string)
disable_autoplan = optional(string)
disable_markdown_folding = optional(string)
disable_repo_locking = optional(string)
enable_policy_checks = optional(string)
enable_regexp_cmd = optional(string)
enable_diff_markdown_format = optional(string)
gh_hostname = optional(string)
gh_token = optional(string)
gh_user = optional(string)
gh_webhook_secret = optional(string)
gh_org = optional(string)
gh_app_id = optional(string)
gh_app_slug = optional(string)
gh_app_key_file = optional(string)
gh_app_key = optional(string)
gh_team_allowlist = optional(string)
gh_allow_mergeable_bypass_apply = optional(string)
gitlab_hostname = optional(string)
gitlab_token = optional(string)
gitlab_user = optional(string)
gitlab_webhook_secret = optional(string)
help = optional(string)
hide_prev_plan_comments = optional(string)
locking_db_type = optional(string)
log_level = optional(string)
markdown_template_overrides_dir = optional(string)
parallel_pool_size = optional(string)
port = optional(string)
quiet_policy_checks = optional(string)
redis_host = optional(string)
redis_password = optional(string)
redis_port = optional(string)
redis_db = optional(string)
redis_tls_enabled = optional(string)
redis_insecure_skip_verify = optional(string)
repo_config = optional(string)
repo_config_json = optional(string)
repo_whitelist = optional(string)
repo_allowlist = optional(string)
require_approval = optional(string)
require_mergeable = optional(string)
silence_fork_pr_errors = optional(string)
silence_whitelist_errors = optional(string)
silence_allowlist_errors = optional(string)
silence_no_projects = optional(string)
silence_vcs_status_no_plans = optional(string)
skip_clone_no_changes = optional(string)
slack_token = optional(string)
ssl_cert_file = optional(string)
ssl_key_file = optional(string)
stats_namespace = optional(string)
tf_download_url = optional(string)
tfe_hostname = optional(string)
tfe_local_execution_mode = optional(string)
tfe_token = optional(string)
var_file_allowlist = optional(string)
vcs_status_name = optional(string)
write_git_creds = optional(string)
web_basic_auth = optional(bool)
web_username = optional(string)
web_password = optional(string)
websocket_check_origin = optional(string)
})
default = {}
}
###########################################
## Atlantis Repos config ##
###########################################
variable "atlantis_repo_config_repos" {
description = "Map of repositories and their configs. Refer to https://www.runatlantis.io/docs/server-side-repo-config.html#example-server-side-repo"
type = list(object({
id = optional(string, "/.*/")
branch = optional(string)
apply_requirements = optional(list(string))
allowed_overrides = optional(list(string))
allowed_workflows = optional(list(string))
allow_custom_workflows = optional(bool)
delete_source_branch_on_merge = optional(bool)
pre_workflow_hooks = optional(list(object({
run = string
})))
post_workflow_hooks = optional(list(object({
run = string
})))
workflow = optional(string)
######### Helpers #########
allow_all_server_side_workflows = optional(bool, false)
terragrunt_atlantis_config = optional(object({
enabled = optional(bool)
output = optional(string)
automerge = optional(bool)
autoplan = optional(bool)
parallel = optional(bool)
cascade_dependencies = optional(bool)
filter = optional(string)
use_project_markers = optional(bool)
}))
}))
default = []
}
variable "atlantis_repo_config_repos_common_config" {
description = "Common config that will be merged into each item of the repos list"
type = object({
id = optional(string)
branch = optional(string)
apply_requirements = optional(list(string))
allowed_overrides = optional(list(string))
allowed_workflows = optional(list(string))
allow_custom_workflows = optional(bool)
delete_source_branch_on_merge = optional(bool)
pre_workflow_hooks = optional(list(object({
run = string
})))
post_workflow_hooks = optional(list(object({
run = string
})))
workflow = optional(string)
######### Helpers #########
allow_all_server_side_workflows = optional(bool, false)
terragrunt_atlantis_config = optional(object({
enabled = optional(bool)
output = optional(string)
automerge = optional(bool)
autoplan = optional(bool)
parallel = optional(bool)
cascade_dependencies = optional(bool)
filter = optional(string)
use_project_markers = optional(bool)
}))
})
default = {}
}
variable "atlantis_repo_config_workflows" {
description = "List of custom workflow that will be added to the repo config file"
type = map(object({
plan = optional(object({
steps = optional(list(object({
env = optional(object({
name = string
command = string
}))
run = optional(string)
multienv = optional(string)
atlantis_step = optional(object({
command = string
extra_args = optional(list(string))
}))
})))
}))
apply = optional(object({
steps = optional(list(object({
env = optional(object({
name = string
command = string
}))
run = optional(string)
multienv = optional(string)
atlantis_step = optional(object({
command = string
extra_args = optional(list(string))
}))
})))
}))
import = optional(object({
steps = optional(list(object({
env = optional(object({
name = string
command = string
}))
run = optional(string)
multienv = optional(string)
atlantis_step = optional(object({
command = string
extra_args = optional(list(string))
}))
})))
}))
state_rm = optional(object({
steps = optional(list(object({
env = optional(object({
name = string
command = string
}))
run = optional(string)
multienv = optional(string)
atlantis_step = optional(object({
command = string
extra_args = optional(list(string))
}))
})))
}))
template = optional(string, "terragrunt-basic")
asdf = optional(object({
enabled = optional(bool, false)
}), {})
checkov = optional(object({
enabled = optional(bool, false)
soft_fail = optional(bool, false)
file = optional(string, "$SHOWFILE")
}), {})
pull_gitlab_variables = optional(object({
enabled = optional(bool, false)
}), {})
check_gitlab_approvals = optional(object({
enabled = optional(bool, false)
}), {}),
infracost = optional(object({
enabled = optional(bool, false)
platform = optional(string, "gitlab")
token_environment_variable = optional(string)
behavior = optional(string, "new")
}), {}),
}))
default = {}
}
variable "atlantis_repo_config_file" {
description = "Configures config file generation if enabled"
type = object({
enabled = optional(bool, false)
path = optional(string, ".")
name = optional(string, "repo_config.yaml")
format = optional(string, "yaml")
})
default = {}
validation {
condition = contains(["yaml", "json"], var.atlantis_repo_config_file.format)
error_message = "Invalid format provided. Allowed values: yaml, json"
}
}
###########################################
## Rest of Azure Container Group Configs ##
###########################################
variable "containers" {
description = "List of containers that will be running in the container group"
type = map(object({
image = string
cpu = number
memory = number
ports = optional(list(object({
port = number
protocol = optional(string, "TCP")
})), [])
commands = optional(list(string), [])
environment_variables = optional(map(string), {})
secure_environment_variables = optional(map(string), {})
secure_environment_variables_from_key_vault = optional(map(object({
key_vault_id = string
name = string
})), {})
volumes = optional(map(object({
mount_path = string
read_only = optional(bool, false)
empty_dir = optional(bool)
git_repo = optional(object({
url = string
directory = optional(string)
revision = optional(string)
}))
secret = optional(map(string))
secret_from_key_vault = optional(map(object({
key_vault_id = string
name = string
})), {})
storage_account_name = optional(string)
storage_account_key = optional(string)
share_name = optional(string)
})), {})
}))
default = {}
}
variable "exposed_ports" {
description = "It can only contain ports that are also exposed on one or more containers in the group"
type = list(object({
port = number
protocol = optional(string, "TCP")
}))
default = []
}
variable "subnet_ids" {
description = "The subnet resource IDs for a container group. At the moment it supports 1 subnet maximum"
type = list(string)
default = []
}
variable "dns_name_label" {
description = "The DNS label/name for the container group's IP. If not provided it will use the name of the resource"
type = string
default = null
}
variable "dns_name_servers" {
description = "DNS name servers configured with containers"
type = list(string)
default = []
}
variable "restart_policy" {
description = "Restart policy for the container group. Allowed values are `Always`, `Never`, `OnFailure`. Defaults to `Always`"
type = string
default = "Always"
validation {
condition = contains(["Always", "Never", "OnFailure"], var.restart_policy)
error_message = "Allowed values are `Always`, `Never` or `OnFailure`"
}
}
variable "identity" {
description = "Managed identity block. For type possible values are: SystemAssigned and UserAssigned"
type = object({
enabled = optional(bool, false)
type = optional(string, "SystemAssigned")
identity_ids = optional(list(string), [])
user_assigned_identity = optional(object({
enabled = optional(bool, false)
descriptor_name = optional(string, "azure-managed-service-identity")
}), {})
role_assignments = optional(list(object({
scope = string
role_definition_name = string
})), [])
})
default = {}
}
variable "image_registry_credential" {
description = "Credentials for ACR, so the images can be pulled by the container instance"
type = list(object({
username = string
password = string
server = string
}))
default = []
}
variable "container_diagnostics_log_analytics" {
description = "Log Analytics workspace to be used with container logs"
type = object({
workspace_id = string
workspace_key = string
log_type = optional(string, "ContainerInsights")
})
default = null
}