diff --git a/infrastructure/modules/storage/main.tf b/infrastructure/modules/storage/main.tf index 6dace3e0..7841a866 100644 --- a/infrastructure/modules/storage/main.tf +++ b/infrastructure/modules/storage/main.tf @@ -134,3 +134,14 @@ module "diagnostic-settings" { enabled_metric = var.monitor_diagnostic_setting_storage_account_metrics } + +module "diagnostic-settings-sa-resource" { + + source = "../diagnostic-settings" + + name = "${azurerm_storage_account.storage_account.name}-diagnotic-setting-storage-account" + target_resource_id = "${azurerm_storage_account.storage_account.id}" + log_analytics_workspace_id = var.log_analytics_workspace_id + enabled_metric = var.monitor_diagnostic_setting_storage_account_resource_metrics + +} diff --git a/infrastructure/modules/storage/variables.tf b/infrastructure/modules/storage/variables.tf index e6464430..d6e98811 100644 --- a/infrastructure/modules/storage/variables.tf +++ b/infrastructure/modules/storage/variables.tf @@ -74,12 +74,18 @@ variable "log_analytics_workspace_id" { variable "monitor_diagnostic_setting_storage_account_enabled_logs" { type = list(string) - description = "Controls what logs will be enabled for the storage" + description = "Controls what logs will be enabled for the storage services" } variable "monitor_diagnostic_setting_storage_account_metrics" { type = list(string) - description = "Controls what metrics will be enabled for the storage" + description = "Controls what metrics will be enabled for the storage services" +} + +variable "monitor_diagnostic_setting_storage_account_resource_metrics" { + type = list(string) + description = "Controls what metrics will be enabled for the storage account itself" + default = ["Transaction"] } variable "private_endpoint_properties" {