Closed prabirkrsarkar closed 2 years ago
hi @prabirkrsarkar
Thanks for opening this issue.
Monitor Diagnostic Settings exist outside the lifecycle of the Resource Group - as such this won't be removed like other resources, as such since Terraform is finding this resource unfortunately this still exists in the API (and so needs to be imported).
This forum is intended to be used for feature enhancements and bugs in the Azure Provider - so that we can keep this forum focused on that we instead ask that broader questions are raised using one of the Community Resources. As such I'm going to close this issue for the moment, but I believe you should be able to get an answer for this using one of the Community Resources.
Thanks!
Thanks @tombuildsstuff. We figured out the same. Once we manually deleted the diag settings in the IoT hub and then deleted the resource group we could redeploy using terraform without any issues.
Thanks.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
$ terraform -v Terraform v1.0.9 on linux_amd64
Affected Resource(s)
azurerm_monitor_diagnostic_setting
azurerm_XXXXX
Terraform Configuration Files
resource "azurerm_monitor_diagnostic_setting" "example" { name = "diagsettings" target_resource_id = data.azurerm_iothub.example.id log_analytics_workspace_id = data.azurerm_log_analytics_workspace.example.id
log { category = "Connections" enabled = true
}
log { category = "DeviceTelemetry" enabled = true
}
}
metric { category = "AllMetrics" enabled = true
} }
Debug Output
Panic Output
Expected Behaviour
Actual Behaviour
Steps to Reproduce
terraform apply
Important Factoids
References
0000