-
Notifications
You must be signed in to change notification settings - Fork 514
Description
Check for previous/existing GitHub issues
- I have checked for previous/existing GitHub issues
Issue Type?
Bug
Module Name
avm/res/key-vault/vault
(Optional) Module Version
No response
Description
When defining KV diagnostic settings, by default, the module is including data which wasn't requested. For example, the code below indicates I would like just Audit logs enabled as I have excluded the Metrics settings. However, the module defaults to 'All Metrics' if no Metric settings are provided.
diagnosticSettings: [
{
name: 'Audit Logs - LogAnalytics'
workspaceResourceId: logAnalytics.id
logCategoriesAndGroups: [
{
categoryGroup: 'audit'
enabled: true
}
]
}
]
This is the current AVM module code...
metrics: [
for group in (diagnosticSetting.?metricCategories ?? [{ category: 'AllMetrics' }]): {
category: group.category
enabled: group.?enabled ?? true
timeGrain: null
}
]
logs: [
for group in (diagnosticSetting.?logCategoriesAndGroups ?? [{ categoryGroup: 'allLogs' }]): {
categoryGroup: group.?categoryGroup
category: group.?category
enabled: group.?enabled ?? true
}
]
In this example, I would think it would be more expected to have the Metrics excluded. The inverse is also true, if Metrics are defined and Logs excluded, you'll get all logs enabled,
With the current AVM code, unexpected log ingress and retention costs could result.
Obviously I can work around this by adding a Metrics array and explicitly disabling it, but I think we can do better.
diagnosticSettings: [
{
name: 'Audit Logs - LogAnalytics'
workspaceResourceId: logAnalytics.id
logCategoriesAndGroups: [
{
categoryGroup: 'audit'
enabled: true
}
]
metricCategories: [
{
category: 'AllMetrics'
enabled: false
}
]
}
]
(Optional) Correlation Id
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status