forked from claranet/terraform-azurerm-db-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
r-logs.tf
56 lines (42 loc) · 1.93 KB
/
r-logs.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
module "pool_logging" {
count = var.logs_destinations_ids != toset([]) && var.elastic_pool_enabled ? 1 : 0
source = "claranet/diagnostic-settings/azurerm"
version = "6.2.0"
resource_id = azurerm_mssql_elasticpool.elastic_pool[0].id
logs_destinations_ids = var.logs_destinations_ids
log_categories = var.logs_categories
metric_categories = var.logs_metrics_categories
retention_days = var.logs_retention_days
use_caf_naming = var.use_caf_naming
custom_name = var.custom_diagnostic_settings_name
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}
module "single_db_logging" {
for_each = { for db in var.databases : db.name => db if var.logs_destinations_ids != toset([]) && var.elastic_pool_enabled == false }
source = "claranet/diagnostic-settings/azurerm"
version = "6.2.0"
resource_id = azurerm_mssql_database.single_database[each.key].id
logs_destinations_ids = var.logs_destinations_ids
log_categories = var.logs_categories
metric_categories = var.logs_metrics_categories
retention_days = var.logs_retention_days
use_caf_naming = var.use_caf_naming
custom_name = var.custom_diagnostic_settings_name
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}
module "elastic_pool_db_logging" {
for_each = { for db in var.databases : db.name => db if var.logs_destinations_ids != toset([]) && var.elastic_pool_enabled == true }
source = "claranet/diagnostic-settings/azurerm"
version = "6.2.0"
resource_id = azurerm_mssql_database.elastic_pool_database[each.key].id
logs_destinations_ids = var.logs_destinations_ids
log_categories = var.logs_categories
metric_categories = var.logs_metrics_categories
retention_days = var.logs_retention_days
use_caf_naming = var.use_caf_naming
custom_name = var.custom_diagnostic_settings_name
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}