Skip to content
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

Modifying a Traffic Manager Profile deletes all Endpoints #7470

Closed
nitzanm opened this issue Jun 24, 2020 · 2 comments
Closed

Modifying a Traffic Manager Profile deletes all Endpoints #7470

nitzanm opened this issue Jun 24, 2020 · 2 comments

Comments

@nitzanm
Copy link
Contributor

nitzanm commented Jun 24, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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

  1. When I modify a Traffic Manager Profile, I expect Terraform to modify the profile and not delete the endpoints inside it.
  2. 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

  1. Terraform deletes all endpoints in the profile when modifying the profile.
  2. 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.

References

@tombuildsstuff
Copy link
Contributor

hi @nitzanm

Thanks for opening this issue :)

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?

Thanks!

@ghost
Copy link

ghost commented Jul 24, 2020

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 ghost locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants