Enhance Azure Storage Account module with additional variables and blob data protection features

This commit is contained in:
2026-02-28 22:10:38 +01:00
parent aa63e41b55
commit 0c86d10d4d
3 changed files with 143 additions and 2 deletions

29
main.tf
View File

@@ -24,6 +24,35 @@ resource "azurerm_storage_account" "this" {
public_network_access_enabled = var.public_network_access_enabled
min_tls_version = "TLS1_2"
blob_properties {
versioning_enabled = var.enable_blob_versioning
change_feed_enabled = var.enable_blob_change_feed
dynamic "delete_retention_policy" {
for_each = var.enable_blob_soft_delete ? [1] : []
content {
days = var.blob_soft_delete_retention_days
}
}
dynamic "container_delete_retention_policy" {
for_each = var.enable_container_soft_delete ? [1] : []
content {
days = var.container_soft_delete_retention_days
}
}
dynamic "restore_policy" {
for_each = var.enable_point_in_time_restore_for_containers ? [1] : []
content {
days = var.point_in_time_restore_days
}
}
}
tags = var.tags
}