Adds log analytics logging to redis module
This commit is contained in:
parent
211a9e7875
commit
b0a73e5944
@ -23,3 +23,16 @@ resource "azurerm_redis_cache" "redis" {
|
|||||||
owner = var.owner
|
owner = var.owner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_monitor_diagnostic_setting" "redis_diagnostic" {
|
||||||
|
name = "${var.name}-${var.environment}-redis-diag"
|
||||||
|
target_resource_id = azurerm_redis_cache.redis.id
|
||||||
|
log_analytics_workspace_id = var.workspace_id
|
||||||
|
metric {
|
||||||
|
category = "AllMetrics"
|
||||||
|
|
||||||
|
retention_policy {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -58,3 +58,8 @@ variable "subnet_id" {
|
|||||||
type = string
|
type = string
|
||||||
description = "Subnet ID that the service_endpoint should reside"
|
description = "Subnet ID that the service_endpoint should reside"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "workspace_id" {
|
||||||
|
description = "Log Analytics workspace for this resource to log to"
|
||||||
|
type = string
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user