Skip to content

Commit

Permalink
Merge pull request #1 from T-Systems-MMS/add_new_attributes
Browse files Browse the repository at this point in the history
Add new attributes
  • Loading branch information
michaelamattes authored Mar 18, 2022
2 parents 7e07656 + 03c3300 commit 827e0dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
11 changes: 7 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
resource "azurerm_monitor_diagnostic_setting" "monitor_diagnostic_setting" {
for_each = var.monitor_diagnostic_setting

name = local.monitor_diagnostic_setting[each.key].name == "" ? each.key : local.monitor_diagnostic_setting[each.key].name

target_resource_id = local.monitor_diagnostic_setting[each.key].target_resource_id
log_analytics_workspace_id = local.monitor_diagnostic_setting[each.key].log_analytics_workspace_id
name = local.monitor_diagnostic_setting[each.key].name == "" ? each.key : local.monitor_diagnostic_setting[each.key].name
target_resource_id = local.monitor_diagnostic_setting[each.key].target_resource_id
eventhub_name = local.monitor_diagnostic_setting[each.key].eventhub_name
eventhub_authorization_rule_id = local.monitor_diagnostic_setting[each.key].eventhub_authorization_rule_id
log_analytics_workspace_id = local.monitor_diagnostic_setting[each.key].log_analytics_workspace_id
log_analytics_destination_type = local.monitor_diagnostic_setting[each.key].log_analytics_destination_type
storage_account_id = local.monitor_diagnostic_setting[each.key].storage_account_id

dynamic "log" {
for_each = local.monitor_diagnostic_setting[each.key].log.category
Expand Down
17 changes: 14 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,27 @@ locals {
default = {
# resource definition
monitor_diagnostic_setting = {
name = ""
name = ""
eventhub_name = null
eventhub_authorization_rule_id = null
log_analytics_workspace_id = null
log_analytics_destination_type = null
storage_account_id = null
log = {
category = []
enabled = false
retention_policy = {}
retention_policy = {
days = 0
enabled = false
}
}
metric = {
category = []
enabled = false
retention_policy = {}
retention_policy = {
days = 0
enabled = false
}
}
}
}
Expand Down

0 comments on commit 827e0dd

Please sign in to comment.