-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_recovery_services_protected_vm is recreating the resource every time #2860
Comments
Hi @kjhosein, It looks like a casing issue is the root cause here. Could you try changing
|
Great eyes @katbyte ! |
I'm having a similar issue with the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.11.10
AzureRM v1.21.0
Affected Resource(s)
azurerm_recovery_services_protected_vm
Terraform Configuration Files
Expected Behavior
Terraform should have seen that the backup enrollment(s) was already in place and ignored it (not attempt to destroy and re-create them).
Actual Behavior
Starting from scratch, Terraform successfully creates the Azure Backup enrollment of the VM(s) in approx 1.5-2 minutes.
Without any changes to the deployed resources or the TF code, re-running
terraform apply
results in a plan that says it has to destroy and re-create the backup:Note that while the
id
attribute is obviously different (existing value vs computed), thebackup_policy_id
attribute is the same but yet says "forces new resource".The other related issue is this:
Saying "yes" to the plan and proceeding results in:
azurerm_recovery_services_protected_vm
resources in approx 1.5 mins.azurerm_recovery_services_protected_vm
resources but never succeeding. I've had multiple tests run past 15 mins before I killed them.Lastly:
3. After killing the TF job in step #2, re-running
terraform apply
runs successfully as it sees that the definedazurerm_recovery_services_protected_vm
resources don't exist and creates them.Steps to Reproduce
terraform apply
on an already deployed set ofazurerm_recovery_services_protected_vm
resources without making any changes.The text was updated successfully, but these errors were encountered: