Adds log analytics logging to cdn module
This commit is contained in:
parent
ffb29d45fc
commit
211a9e7875
@ -29,3 +29,15 @@ resource "azurerm_cdn_endpoint" "cdn" {
|
||||
host_name = var.origin_host_name
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_monitor_diagnostic_setting" "acr_diagnostic" {
|
||||
name = "${var.name}-${var.environment}-acr-diag"
|
||||
target_resource_id = azurerm_cdn_endpoint.cdn.id
|
||||
log_analytics_workspace_id = var.workspace_id
|
||||
log {
|
||||
category = "CoreAnalytics"
|
||||
retention_policy {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,3 +29,7 @@ variable "origin_host_name" {
|
||||
description = "Subdomain to use for the origin in requests to the CDN"
|
||||
}
|
||||
|
||||
variable "workspace_id" {
|
||||
description = "Log Analytics Workspace ID for sending logs generated by this resource"
|
||||
type = string
|
||||
}
|
@ -5,4 +5,5 @@ module "cdn" {
|
||||
environment = var.environment
|
||||
name = var.name
|
||||
region = var.region
|
||||
workspace_id = module.logs.workspace_id
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user