Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Commit

Permalink
removing former activity logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuen committed Apr 23, 2020
1 parent f6c4ebb commit dba6029
Showing 1 changed file with 16 additions and 66 deletions.
82 changes: 16 additions & 66 deletions module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,116 +55,66 @@ resource "azurerm_monitor_diagnostic_setting" "audit" {

log {
category = "Administrative"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "Security"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "ServiceHealth"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "Alert"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "Recommendation"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "Policy"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "Autoscale"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
log {
category = "ResourceHealth"
enabled = true
retention_policy {
days = 0
enabled = false
}
}
}

resource "azurerm_monitor_log_profile" "subscription" {
name = "default"

categories = [
"Action",
"Delete",
"Write"
]

# Add all regions - > put in variable
# az account list-locations --query '[].name'
# updated Dec 15 2019 checked March 2020
locations = [
"global",
"eastasia",
"southeastasia",
"centralus",
"eastus",
"eastus2",
"westus",
"northcentralus",
"southcentralus",
"northeurope",
"westeurope",
"japanwest",
"japaneast",
"brazilsouth",
"australiaeast",
"australiasoutheast",
"southindia",
"centralindia",
"westindia",
"canadacentral",
"canadaeast",
"uksouth",
"ukwest",
"westcentralus",
"westus2",
"koreacentral",
"koreasouth",
"francecentral",
"francesouth",
"australiacentral",
"australiacentral2",
"uaecentral",
"uaenorth",
"southafricanorth",
"southafricawest",
"switzerlandnorth",
"switzerlandwest",
"germanynorth",
"germanywestcentral",
"norwaywest",
"norwayeast"
]

# RootManageSharedAccessKey is created by default with listen, send, manage permissions
servicebus_rule_id = var.enable_event_hub == true ? "${azurerm_eventhub_namespace.log[0].id}/authorizationrules/RootManageSharedAccessKey" : null
storage_account_id = azurerm_storage_account.log.id

retention_policy {
enabled = true
days = var.logs_rentention
}
}

0 comments on commit dba6029

Please sign in to comment.