Closed samuelyee closed 2 years ago
Thanks for reporting those re-creation issues. In the last 6 months we had improved the aztfmod module to handle those situations and bring a more stable behaviour when you add new resource groups. I propose you re-test with the latest aztfmod module https://registry.terraform.io/modules/aztfmod/caf/azurerm/latest
Closing it now.
Even if there is no change to the existing resource, rover will sometime force a re-creation of the resource. It can be disruptive especially for storage with existing objects.
Consider the following example where the creation of storage module is dependent on a variable app_rg_name for a specific named Azure resource group: configuration.tfvars
solution.tf
If I were just to add another new resource group without affecting the storage module e.g. configuration.tfvars
It will force a re-creation of the storage module when running plan or apply, even though there is no change to the module.
After spending much time without clues, I realised that I have to set the local variable "app_rg_name" to a fixed value rather than conditional to avoid a forced re-creation. Would be good if you can add a mechanism, such as -target to limit the scope of plan/apply, for avoiding a forced re-creation and debugging.