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

Network rule collection deleted when updating tags on firewall #2621

Closed
jlucktay opened this issue Jan 8, 2019 · 2 comments · Fixed by #2663
Closed

Network rule collection deleted when updating tags on firewall #2621

jlucktay opened this issue Jan 8, 2019 · 2 comments · Fixed by #2663

Comments

@jlucktay
Copy link

jlucktay commented Jan 8, 2019

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 -v
Terraform v0.11.11
+ provider.azurerm v1.20.0

Affected Resource(s)

  • azurerm_firewall
  • azurerm_firewall_network_rule_collection

Terraform Configuration Files

All of the necessary Terraform templates to recreate this issue are in this gist.

Expected Behavior

Terraform should have added/updated the tags on the Firewall.

Actual Behavior

Terraform added/updated the tags on the Firewall, and also deleted the network rule collection.

A subsequent terraform plan included the (re)creation of the network rule collection.

Steps to Reproduce

  1. Using the Terraform templates in the linked gist, run terraform plan and terraform apply.
  2. In the Azure portal, navigate to the firewall's network rule collections, and confirm the existence of the network rule collection described in the Terraform templates.
  3. In the Terraform templates, make a change to the azurerm_firewall resource, e.g. add a new tag or edit an existing one in terraform.tfvars.
  4. Run terraform plan and terraform apply again.
  5. Refresh the network rule collections in the Azure portal.

Important Factoids

Our discovery of this issue came when updating tags to meet compliance, and the inadvertent removal of the above network rule collection led to some resources not having internet access briefly.

@hbuckle
Copy link
Contributor

hbuckle commented Jan 14, 2019

I see the problem - the API treats the firewall as one big object so when the tags are updated it is overwriting the rules. I've submitted a PR to resolve

@ghost
Copy link

ghost commented Mar 5, 2019

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants