Azure / Azure/Azure-Verified-Modules

[Module Proposal]: `avm-res-monitor-diagnostic-setting`

Open
#2,273 12 comments 0 reactions 2 assignees Claimed by @matt-FFFFFF View on GitHub
Language: Terraform :globe_with_meridians: Status: Long Term :hourglass_flowing_sand:
Dominant language
PowerShell
Stars
580
Forks
161
Avg merge
11h 3m
Merged PRs (30d)
15

Description

### Check for previous/existing GitHub issues/module proposals

- [x] I have checked for previous/existing GitHub issues/module proposals.

### Check this module doesn't already exist in the module indexes

- [x] I have checked for that this module doesn't already exist in the module indexes.

### Bicep or Terraform?

Terraform

### Module Classification?

Resource Module

### Module Name

avm-res-monitor-diagnostic-setting

### Module Details

This proposal is to introduce a reusable Terraform module to manage Azure Monitor Diagnostic Settings consistently across any Azure resource.

An earlier discussion on this topic happened in [AVM Issue #918](https://github.com/Azure/Azure-Verified-Modules/issues/918)
, but it was closed without a concrete resolution regarding whether a dedicated module adds value or aligns with AVM guidance.

Currently, each AVM resource module implements its own diagnostic settings logic, which leads to:

- > Duplication of code across modules.

- > High maintenance cost when Azure introduces new diagnostic categories or when organizational logging policies change.

- > Inconsistent configurations if individual module owners make different design decisions.

A centralized, single-purpose diagnostic settings module would:

- > Promote consistency and compliance organization-wide.

- > Reduce maintenance overhead by upgrading logic once in a single location.

- > Allow solution teams to decide what to log intelligently, avoiding unnecessary Log Analytics ingestion and retention costs.

- > Still align with AVM guidance by making diagnostic settings optional for each resource, but implemented through a shared component.

**Value Proposition**

- DRY (Don’t Repeat Yourself): A single source of truth for diagnostic configuration.

- Composable Design: High cohesion (diagnostics only), low coupling (can attach to any AVM resource module).

- Governance & Compliance: Simplified enforcement of org-wide logging standards.

- Cost Optimization: Avoid dumping unnecessary metrics into Log Analytics (since metrics are retained for free for 90 days).

- Future-proofing: Quick updates to all workloads by upgrading one module.

### Do you want to be the owner of this module?

Yes

### Module Owner's GitHub Username (handle)

EAR009

### (Optional) Secondary Module Owner's GitHub Username (handle)

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.