You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't included debug output as I think the issue is pretty clear; let me know if someone needs to see debug output.
Panic Output
N/A
Expected Behavior
When I modify a Traffic Manager Profile, I expect Terraform to modify the profile and not delete the endpoints inside it.
I expect terraform plan to return an empty plan right after applying a plan, when there have been no changes to the TF files nor to the configuration in Azure.
Actual Behavior
Terraform deletes all endpoints in the profile when modifying the profile.
Terraform plans to re-add them after another refresh.
Steps to Reproduce
Place sample-1.tf.json in a directory. Add a provider block specifying azurerm version 2.14.0 and with some credentials.
Run terraform init
Run terraform apply and approve the plan.
Confirm in the portal that you now have a Traffic Manager profile with two endpoints.
Replace sample-1.tf.json with sample-2.tf.json.
Note that the diff between the two is simply a change in the monitor configuration.
Run terraform apply. Note that the plan is modifying the monitor config - not touching the endpoints. Approve the plan.
Note in the portal that now the Traffic Manager profile has zero endpoints!
Run terraform plan. Note that the plan is now adding the two missing endpoints.
Important Factoids
This happens because the Traffic Manager Profile update is a PUT request. PUT, by definition, replaces the entire object. Since the list of endpoints is part of the Profile object in Azure, it is cleared because Terraform doesn't specify it in the PUT request.
It is possible that Update/replace resource when a dependency is changed terraform#8099 would fix this, but I would still consider this a bug in the provider, because deleting all endpoints and then re-creating them is not a desired side effect of changing monitor config. Plus, it doesn't appear that issue is being fixed soon, and in the meantime I suggest we work around it rather than accept a reality where Terraform deletes resources where it shouldn't - especially since these resources are likely to kill a production deployment.
The text was updated successfully, but these errors were encountered:
Taking a look through this appears to be a duplicate of #6041 - rather than having multiple issues open tracking the same thing I'm going to close this issue in favour of that one; would you mind subscribing to #6041 for updates?
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!
ghost
locked and limited conversation to collaborators
Jul 24, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.9
Azure Provider version v2.14
Affected Resource(s)
azurerm_traffic_manager_profile
azurerm_traffic_manager_endpoint
Terraform Configuration Files
https://gist.github.com/nitzanm/abca894e70ac76676db5ed656ff2bcc5
Debug Output
I haven't included debug output as I think the issue is pretty clear; let me know if someone needs to see debug output.
Panic Output
N/A
Expected Behavior
terraform plan
to return an empty plan right after applying a plan, when there have been no changes to the TF files nor to the configuration in Azure.Actual Behavior
Steps to Reproduce
sample-1.tf.json
in a directory. Add a provider block specifying azurerm version2.14.0
and with some credentials.terraform init
terraform apply
and approve the plan.sample-1.tf.json
withsample-2.tf.json
.terraform apply
. Note that the plan is modifying the monitor config - not touching the endpoints. Approve the plan.terraform plan
. Note that the plan is now adding the two missing endpoints.Important Factoids
This happens because the Traffic Manager Profile update is a PUT request. PUT, by definition, replaces the entire object. Since the list of endpoints is part of the Profile object in Azure, it is cleared because Terraform doesn't specify it in the PUT request.
References
The text was updated successfully, but these errors were encountered: