Skip to content

Commit

Permalink
feat: prevent accidental destroy of Storage account (#235)
Browse files Browse the repository at this point in the history
* feat: prevent accidental deletion of Storage account

* Update main.tf
  • Loading branch information
hknutsen authored Oct 9, 2024
1 parent 43f8a87 commit 11b7cb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ resource "azurerm_storage_account" "this" {
}

lifecycle {
# Prevent accidental destroy 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."
Expand Down

0 comments on commit 11b7cb6

Please sign in to comment.