Skip to content

Commit

Permalink
Updated management policy
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindelmont committed Nov 15, 2024
1 parent faed5de commit 0d69bb0
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions modules/storage_account/management_policy/management_policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,45 @@ resource "azurerm_storage_management_policy" "mgmt_policy" {
content {
tier_to_cool_after_days_since_modification_greater_than = try(base_blob.value.tier_to_cool_after_days_since_modification_greater_than, null)
tier_to_cool_after_days_since_last_access_time_greater_than = try(base_blob.value.tier_to_cool_after_days_since_last_access_time_greater_than, null)
tier_to_cool_after_days_since_creation_greater_than = try(base_blob.value.tier_to_cool_after_days_since_creation_greater_than, null)
auto_tier_to_hot_from_cool_enabled = try(base_blob.value.auto_tier_to_hot_from_cool_enabled, null)
tier_to_archive_after_days_since_modification_greater_than = try(base_blob.value.tier_to_archive_after_days_since_modification_greater_than, null)
tier_to_archive_after_days_since_last_access_time_greater_than = try(base_blob.value.tier_to_archive_after_days_since_last_access_time_greater_than, null)
tier_to_archive_after_days_since_creation_greater_than = try(base_blob.value.tier_to_archive_after_days_since_creation_greater_than, null)
tier_to_archive_after_days_since_last_tier_change_greater_than = try(base_blob.value.tier_to_archive_after_days_since_last_tier_change_greater_than, null)
tier_to_cold_after_days_since_modification_greater_than = try(base_blob.value.tier_to_cold_after_days_since_modification_greater_than, null)
tier_to_cold_after_days_since_last_access_time_greater_than = try(base_blob.value.tier_to_cold_after_days_since_last_access_time_greater_than, null)
tier_to_cold_after_days_since_creation_greater_than = try(base_blob.value.tier_to_cold_after_days_since_creation_greater_than, null)
delete_after_days_since_modification_greater_than = try(base_blob.value.delete_after_days_since_modification_greater_than, null)
delete_after_days_since_last_access_time_greater_than = try(base_blob.value.delete_after_days_since_last_access_time_greater_than, null)
delete_after_days_since_creation_greater_than = try(base_blob.value.delete_after_days_since_creation_greater_than, null)
}
}

dynamic "snapshot" {
for_each = try(rule.value.actions.snapshot, {})

content {
change_tier_to_archive_after_days_since_creation = try(snapshot.value.change_tier_to_archive_after_days_since_creation, null)
change_tier_to_cool_after_days_since_creation = try(snapshot.value.change_tier_to_cool_after_days_since_creation, null)
delete_after_days_since_creation_greater_than = try(snapshot.value.delete_after_days_since_creation_greater_than, null)
change_tier_to_archive_after_days_since_creation = try(snapshot.value.change_tier_to_archive_after_days_since_creation, null)
tier_to_archive_after_days_since_last_tier_change_greater_than = try(snapshot.value.tier_to_archive_after_days_since_last_tier_change_greater_than, null)
change_tier_to_cool_after_days_since_creation = try(snapshot.value.change_tier_to_cool_after_days_since_creation, null)
tier_to_cold_after_days_since_creation_greater_than = try(snapshot.value.tier_to_cold_after_days_since_creation_greater_than, null)
delete_after_days_since_creation_greater_than = try(snapshot.value.delete_after_days_since_creation_greater_than, null)
}
}

dynamic "version" {
for_each = try(rule.value.actions.version, {})

content {
change_tier_to_archive_after_days_since_creation = try(version.value.change_tier_to_archive_after_days_since_creation, null)
change_tier_to_cool_after_days_since_creation = try(version.value.change_tier_to_cool_after_days_since_creation, null)
delete_after_days_since_creation = try(version.value.delete_after_days_since_creation, null)
change_tier_to_archive_after_days_since_creation = try(version.value.change_tier_to_archive_after_days_since_creation, null)
tier_to_archive_after_days_since_last_tier_change_greater_than = try(version.value.tier_to_archive_after_days_since_last_tier_change_greater_than, null)
change_tier_to_cool_after_days_since_creation = try(version.value.change_tier_to_cool_after_days_since_creation, null)
tier_to_cold_after_days_since_creation_greater_than = try(version.value.tier_to_cold_after_days_since_creation_greater_than, null)
delete_after_days_since_creation = try(version.value.delete_after_days_since_creation, null)
}
}
}
}
}
}
}

0 comments on commit 0d69bb0

Please sign in to comment.