Skip to content

Commit

Permalink
added lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
kimForWork committed Feb 27, 2024
1 parent d69ebc6 commit 32c6173
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 @@ -204,6 +204,8 @@ resource "azurerm_managed_disk" "data_disks" {
create_option, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS
source_resource_id, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS
tags, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS
zone, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS

]
}
}
Expand All @@ -219,6 +221,7 @@ resource "azurerm_virtual_machine_data_disk_attachment" "data_disks" {
lifecycle {
ignore_changes = [
managed_disk_id, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS
virtual_machine_id, # Prevent restored data disks from causing terraform to attempt to re-create the original os disk name and break the restores OS
]
}
}
Expand Down

0 comments on commit 32c6173

Please sign in to comment.