From e1408ad63fce125b389544e2bb78fc79b1c141d3 Mon Sep 17 00:00:00 2001 From: Henrik Knutsen <46495473+hknutsen@users.noreply.github.com> Date: Mon, 16 Sep 2024 08:38:19 +0200 Subject: [PATCH 1/2] feat: prevent accidental deletion of Storage account --- main.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.tf b/main.tf index 6309c72..4d27108 100644 --- a/main.tf +++ b/main.tf @@ -148,6 +148,9 @@ resource "azurerm_storage_account" "this" { } lifecycle { + # Prevent accidental deletion of Storage account. + prevent_destroy = true + precondition { condition = var.blob_restore_policy_days < var.blob_delete_retention_policy_days error_message = "Blob restore policy days must be less than blob delete retention policy days." From d35963e6d531dd1ab71f0f6fe4e7db9b2d5bafc2 Mon Sep 17 00:00:00 2001 From: Henrik Simonsen Knutsen <46495473+hknutsen@users.noreply.github.com> Date: Mon, 16 Sep 2024 08:41:55 +0200 Subject: [PATCH 2/2] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 4d27108..0affdab 100644 --- a/main.tf +++ b/main.tf @@ -148,7 +148,7 @@ resource "azurerm_storage_account" "this" { } lifecycle { - # Prevent accidental deletion of Storage account. + # Prevent accidental destroy of Storage account. prevent_destroy = true precondition {