Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save archmangler/da7ec57ed04c5143e3aa0e318a674b2c to your computer and use it in GitHub Desktop.

Select an option

Save archmangler/da7ec57ed04c5143e3aa0e318a674b2c to your computer and use it in GitHub Desktop.
terraform azurerm azure fw debug output
- After terraform destroy, we attempt to run terraform plan again but get the following errors:
```
3 error(s) occurred:
* module.firewall_outbound_region2.azurerm_firewall_application_rule_collection.outbound[1]: 1 error(s) occurred:
* azurerm_firewall_application_rule_collection.outbound.1 Error creating/updating Application Rule Collection "rule-lolcorp-dev-mydept-02" in Firewall
"afw-lolcorp-hub-region2-out" (Resource Group: "rsg-lolcorp-hub-region2-networkfrontend"): network.AzureFirewallsClient#CreateorUpdate: Failure sending request:
StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details = [{"code","DuplicateResourceName"},"message",
"Resource /subscriptions//resourceGroups//providers/Microsoft.Network/azureFirewalls/ has two child resources with the same name
(rule-lolcorp-dev-mydept-02)."}]
* module.firewall_outbound_region2.azurerm_firewall_application_rule_collection.outbound[2]: 1 error(s) occurred:
* azurerm_firewall_application_rule_collection.outbound.2 Error creating/updating Application Rule Collection "rule-lolcorp-dev-mydept-03" in Firewall
"afw-lolcorp-hub-region2-out" (Resource Group: "rsg-lolcorp-hub-region2-networkfrontend"): network.AzureFirewallsClient#CreateorUpdate: Failure sending request:
StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details =
[{"code","DuplicateResourceName"},"message","Resource /subscriptions//resourceGroups//providers/Microsoft.Network/azureFirewalls/ has
two child resources with the same name (rule-lolcorp-dev-mydept-03)."}]
* module.firewall_outbound_region2.azurerm_firewall_application_rule_collection.outbound[4]: 1 error(s) occurred:
* azurerm_firewall_application_rule_collection.outbound.2 Error creating/updating Application Rule Collection "rule-lolcorp-dev-mydept-05" in Firewall
"afw-lolcorp-hub-region1-out" (Resource Group: "rsg-lolcorp-hub-region1-networkfrontend"): network.AzureFirewallsClient#CreateorUpdate: Failure sending request:
StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details =
[{"code","DuplicateResourceName"},"message","Resource /subscriptions//resourceGroups//providers/Microsoft.Network/azureFirewalls/ has two child resources with the same name (rule-lolcorp-dev-mydept-05)."}]
* module.firewall_outbound_region2.azurerm_firewall_application_rule_collection.outbound[6]: 1 error(s) occurred:
```
- To fix this we had to use az cli to delete the rules from Azure, e.g:
```
az network firewall application-rule collection delete --collection-name ${targetCollection} --firewall-name ${targetFw} --resource-group ${targetRsg}
```
NOTE: The rules did not appear as duplicates in the terraform state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment