Open ajklotz opened 3 years ago
Try to put delete_nested_items_during_deletion = false
(part of features block) inside the provider block. Something like this:
provider "azurerm" {
...
features {
template_deployment {
delete_nested_items_during_deletion = false
}
}
...
}
There is a note at the end of this documentation page with a bit more details of how destroy works with templates.
Try to put
delete_nested_items_during_deletion = false
(part of features block) inside the provider block. Something like this:provider "azurerm" { ... features { template_deployment { delete_nested_items_during_deletion = false } } ... }
There is a note at the end of this documentation page with a bit more details of how destroy works with templates.
That solution doesn't seem like it would work. The template deployment I'm using doesn't create nested resources. It is the only resource being created. Also, by indicating that I don't want to delete a resource, then it won't recreate it, which is the goal here.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Error: removing items provisioned by this Template Deployment: deleting Nested Resource "/subscriptions/000-000-000-000/resourceGroups/rg/providers/Microsoft.Web/sites/api/slots/staging/config/web": pollingTrackerBase#updateRawBody: failed to unmarshal response body: StatusCode=0 -- Original Error: invalid character '<' looking for beginning of value
Expected Behaviour
Actual Behaviour
Terraform should successfully destroy tainted resources and be able to recreate it on the next apply
Error thrown
Steps to Reproduce
terraform taint module.region1.azurerm_resource_group_template_deployment.api_virtual_directory
terraform apply
Important Factoids
Since I'm currently fighting a bug/issue with azurerm_resource_group_template_deployment not detecting drift, I tried tainting the object to recreate it entirely, but now I'm running into this problem.
References
0000