Skip to content

Allow tags for each data_disk - #90

Merged
rswrz merged 1 commit into
mainfrom
add-data-disk-tags
Feb 25, 2026
Merged

Allow tags for each data_disk#90
rswrz merged 1 commit into
mainfrom
add-data-disk-tags

Conversation

@rswrz

@rswrz rswrz commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Add support for per–data disk tagging by extending the data_disks schema with an optional tags map and merging those tags with the module-level var.tags when creating azurerm_managed_disk resources.

What Changed

  • Extended data_disks object type to include an optional tags map (default {}).
  • Updated documentation in README.md and variables.tf.
  • Updated disk resource tagging logic to merge global and per-disk tags.

Why

Consumers may require disk-specific metadata (e.g., cost center, classification, backup policy) while maintaining a consistent baseline tag set across the module. This change enables flexible tagging without duplicating resources or modifying module structure.

Impact

  • Backwards compatible: existing configurations continue to work unchanged.
  • New capability: per-disk tags via data_disks[*].tags.
  • Precedence rule: per-disk tags override var.tags on key conflicts.
  • Edge case: if var.tags is ever set to null, merge() would fail (assuming var.tags is expected to be a map).

Signed-off-by: Roman Schwarz <rs@cloudeteer.de>
@rswrz
rswrz enabled auto-merge (squash) February 25, 2026 12:52
@rswrz rswrz added the feature label Feb 25, 2026
@rswrz
rswrz disabled auto-merge February 25, 2026 16:41
@rswrz
rswrz merged commit 9e02432 into main Feb 25, 2026
6 of 7 checks passed
@rswrz
rswrz deleted the add-data-disk-tags branch February 25, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant