You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
------ Destroy -----
/opt/hostedtoolcache/terraform/1.5.4/x64/terraform apply -auto-approve tfplandestroy
azurerm_datadog_monitor_tag_rule.example: Destroying... [id=/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog/tagRules/default]
azurerm_role_assignment.example: Destroying... [id=/subscriptions/***/providers/Microsoft.Authorization/roleAssignments/d686901f-03a1-8ec9-ef55-272c4eec17d1]
azurerm_role_assignment.example: Destruction complete after 2s
azurerm_datadog_monitor_tag_rule.example: Destruction complete after 2s
azurerm_datadog_monitor.adusa_datadog: Destroying... [id=/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog]
azurerm_datadog_monitor.adusa_datadog: Still destroying... [id=/subscriptions/...adog/monitors/nonprd-rbs-skele-datadog, 10s elapsed]
azurerm_datadog_monitor.adusa_datadog: Destruction complete after 11s
azurerm_resource_group_policy_exemption.loc_exemption: Destroying... [id=/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Authorization/policyExemptions/datadogMonitorLocation]
azurerm_resource_group_policy_exemption.loc_exemption: Destruction complete after 1s
azurerm_resource_group.rgdatadog: Destroying... [id=/subscriptions/***/resourceGroups/rg-datadog]
azurerm_resource_group.rgdatadog: Still destroying... [id=/subscriptions/***/resourceGroups/rg-datadog, 10s elapsed]
azurerm_resource_group.rgdatadog: Still destroying... [id=/subscriptions/***/resourceGroups/rg-datadog, 20s elapsed]
azurerm_resource_group.rgdatadog: Still destroying... [id=/subscriptions/***/resourceGroups/rg-datadog, 30s elapsed]
azurerm_resource_group.rgdatadog: Still destroying... [id=/subscriptions/***/resourceGroups/rg-datadog, 40s elapsed]
azurerm_resource_group.rgdatadog: Destruction complete after 46s
Apply complete! Resources: 0 added, 0 changed, 5 destroyed.
------ Apply -----
azurerm_resource_group.rgdatadog: Creating...
azurerm_resource_group.rgdatadog: Creation complete after 0s [id=/subscriptions/***/resourceGroups/rg-datadog]
azurerm_resource_group_policy_exemption.loc_exemption: Creating...
azurerm_resource_group_policy_exemption.loc_exemption: Creation complete after 1s [id=/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Authorization/policyExemptions/datadogMonitorLocation]
azurerm_datadog_monitor.adusa_datadog: Creating...
azurerm_datadog_monitor.adusa_datadog: Still creating... [10s elapsed]
azurerm_datadog_monitor.adusa_datadog: Still creating... [20s elapsed]
azurerm_datadog_monitor.adusa_datadog: Creation complete after 25s [id=/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog]
azurerm_datadog_monitor_tag_rule.example: Creating...
azurerm_role_assignment.example: Creating...
azurerm_role_assignment.example: Still creating... [10s elapsed]
azurerm_role_assignment.example: Still creating... [20s elapsed]
azurerm_role_assignment.example: Creation complete after 22s [id=/subscriptions/***/providers/Microsoft.Authorization/roleAssignments/518d595d-956e-9080-a8b1-32daeb9f484f]
╷
│ Error: A resource with the ID "/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog/tagRules/default" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for"azurerm_datadog_monitor_tag_rule"for more information.
│
│ with azurerm_datadog_monitor_tag_rule.example,
│ on main.tf line 52, in resource "azurerm_datadog_monitor_tag_rule""example":
│ 52: resource "azurerm_datadog_monitor_tag_rule""example" {
│
╵
##[debug]Exit code 1 received from tool '/opt/hostedtoolcache/terraform/1.5.4/x64/terraform'##[debug]STDIO streams have closed for tool '/opt/hostedtoolcache/terraform/1.5.4/x64/terraform'##[debug]allowTelemetryCollection=true##[error]Terraform command 'apply' failed with exit code '1'.
Expected Behaviour
After Terraform Destroy, resources can be recreated without error.
Actual Behaviour
When attempting to recreate, receive a resource already exists error for azurerm_datadog_monitor_tag_rule.
Apply only succeeds when resource is manually removed through Azure Powershell, Remove-AzResource, before the destroy step.
Error: A resource with the ID "/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog/tagRules/default" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_datadog_monitor_tag_rule" for more information.
Steps to Reproduce
terraform apply to create azurerm_datadog_monitor and azurerm_datadog_monitor_tag_rule resources.
terraform destroy
terraform apply to recreate - causes error
Important Factoids
Using the Datadog US3 region which requires the location of the azurerm_datadog_monitor to be westus2.
References
No response
The text was updated successfully, but these errors were encountered:
I have also encountered this issue without Terraform Destroy.
When the Microsoft.Datadog/monitors resource is removed outside of Terraform (without removing the tagrules/default resource first), the apply also fails with the same error.
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.
Is there an existing issue for this?
Community Note
Terraform Version
1.5.4
AzureRM Provider Version
3.67.0
Affected Resource(s)/Data Source(s)
azurerm_datadog_monitor_tag_rule, azurerm_datadog_monitor
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
After Terraform Destroy, resources can be recreated without error.
Actual Behaviour
When attempting to recreate, receive a resource already exists error for azurerm_datadog_monitor_tag_rule.
Apply only succeeds when resource is manually removed through Azure Powershell, Remove-AzResource, before the destroy step.
Error: A resource with the ID "/subscriptions/***/resourceGroups/rg-datadog/providers/Microsoft.Datadog/monitors/nonprd-rbs-skele-datadog/tagRules/default" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_datadog_monitor_tag_rule" for more information.
Steps to Reproduce
Important Factoids
Using the Datadog US3 region which requires the location of the azurerm_datadog_monitor to be westus2.
References
No response
The text was updated successfully, but these errors were encountered: