generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
local.sql.tf
72 lines (72 loc) · 2.72 KB
/
local.sql.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
locals {
flatten_sql_container_functions = flatten(
[
for sql_container_key, sql_container in local.sql_containers :
[
for function_key, function_params in sql_container.container_params.functions : {
function_params = function_params
container_key = sql_container_key
function_name = function_params.name
db_name = sql_container.db_name
container_name = sql_container.container_name
}
]
]
)
flatten_sql_container_stored_procedures = flatten(
[
for sql_container_key, sql_container in local.sql_containers :
[
for stored_key, stored_params in sql_container.container_params.stored_procedures : {
stored_params = stored_params
container_key = sql_container_key
stored_name = stored_params.name
db_name = sql_container.db_name
container_name = sql_container.container_name
}
]
]
)
flatten_sql_container_triggers = flatten(
[
for sql_container_key, sql_container in local.sql_containers :
[
for trigger_key, trigger_params in sql_container.container_params.triggers : {
trigger_params = trigger_params
container_key = sql_container_key
trigger_name = trigger_params.name
db_name = sql_container.db_name
container_name = sql_container.container_name
}
]
]
)
flatten_sql_containers = flatten(
[
for db_name, db_params in var.sql_databases :
[
for container_key, container_params in db_params.containers : {
db_name = db_name
container_params = container_params
container_name = container_params.name
}
]
]
)
sql_container_functions = {
for sql_container_function in local.flatten_sql_container_functions :
"${sql_container_function.db_name}|${sql_container_function.container_name}|${sql_container_function.function_name}" => sql_container_function
}
sql_container_stored_procedures = {
for sql_container_stored_procedure in local.flatten_sql_container_stored_procedures :
"${sql_container_stored_procedure.db_name}|${sql_container_stored_procedure.container_name}|${sql_container_stored_procedure.stored_name}" => sql_container_stored_procedure
}
sql_container_triggers = {
for sql_container_trigger in local.flatten_sql_container_triggers :
"${sql_container_trigger.db_name}|${sql_container_trigger.container_name}|${sql_container_trigger.trigger_name}" => sql_container_trigger
}
sql_containers = {
for sql_container in local.flatten_sql_containers :
"${sql_container.db_name}|${sql_container.container_name}" => sql_container
}
}