Skip to content

Commit

Permalink
feat: add diagnostic setting name variable (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianlolv authored Mar 14, 2024
1 parent 41a66d3 commit b5e2ddd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ resource "azurerm_advanced_threat_protection" "this" {
resource "azurerm_monitor_diagnostic_setting" "this" {
for_each = toset(["blob", "queue", "table", "file"])

name = "audit-logs"
name = var.diagnostic_setting_name
target_resource_id = "${azurerm_storage_account.this.id}/${each.value}Services/default"
log_analytics_workspace_id = var.log_analytics_workspace_id

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ variable "log_analytics_workspace_id" {
type = string
}

variable "diagnostic_setting_name" {
description = "The name of this diagnostic setting."
type = string
default = "audit-logs"
}

variable "diagnostic_setting_enabled_log_categories" {
description = "A list of log categories to be enabled for this diagnostic setting."
type = list(string)
Expand Down

0 comments on commit b5e2ddd

Please sign in to comment.