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
Error azurerm_monitor_diagnostic_setting produced an unexpected new value: Root resource was present, but now absent for trafficmanager and frontdoor
#25676
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 and review the contribution guide to help.
Terraform Version
1.5.7
AzureRM Provider Version
3.85.0
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
#terraform {
required_providers {
azurerm={
source ="hashicorp/azurerm"
version ="3.85.0"
}
azuread={
source ="hashicorp/azuread"
version ="~> 2.46.0"
}
}
required_version=">=0.14.9"backend"azurerm" {
}
}
resource"azurerm_monitor_diagnostic_setting""fdazurediagnostics" {
count=length(var.loganalyticsworkspaceid) >0?1:0name=format("%s-analytics", var.name)
target_resource_id=var.targetresourceidlog_analytics_workspace_id=var.loganalyticsworkspaceidenabled_log {
category_group="AllLogs"retention_policy {
enabled=false
}
}
metric {
category="AllMetrics"enabled=trueretention_policy {
enabled=false
}
}
lifecycle {
ignore_changes=[log, metric, log_analytics_destination_type]
}
}
resource"azurerm_monitor_diagnostic_setting""fdazurediagnosticssecurity" {
count=length(var.securityeventhubauthorizationruleid) >0?1:0name=format("%s-securitylogs", var.name)
target_resource_id=var.targetresourceideventhub_name=var.securityeventhubnameeventhub_authorization_rule_id=var.securityeventhubauthorizationruleidenabled_log {
category="FrontDoorAccessLog"retention_policy {
enabled=false
}
}
lifecycle {
ignore_changes=[log, metric, log_analytics_destination_type]
}
}
variables.tf============================variable"loganalyticsworkspaceid" {
type=stringdescription="Name of Log Analytics workspace. Pass empty string to omit for development purposes"
}
variable"securityeventhubname" {
type=stringdescription="Name of Security Event Hub Name. Pass empty string to omit for development purposes"
}
variable"securityeventhubauthorizationruleid" {
type=stringdescription="ID of Security Event Hub Auth Rule. Pass empty string to omit for development purposes"
}
variable"name" {
type=stringdescription="Front Door Name"
}
variable"targetresourceid" {
type=string
}
Debug Output/Panic Output
Error: Provider produced inconsistent result after apply
2024-04-18T09:16:18.5269378Z stdout:
2024-04-18T09:16:18.5269501Z stdout: When applying changes to
2024-04-18T09:16:18.5269987Z stdout: module.frontdoor["s00803NFD999991sltfm090728dev"].module.fdazurediagnostics[0].azurerm_monitor_diagnostic_setting.fdazurediagnostics[0],
2024-04-18T09:16:18.5270279Z stdout: provider "provider[\"registry.terraform.io/hashicorp/azurerm\"]" produced an
2024-04-18T09:16:18.5270491Z stdout: unexpected new value: Root resource was present, but now absent.
2024-04-18T09:16:18.5270841Z stdout:
2024-04-18T09:16:18.5271133Z stdout: This is a bug in the provider, which should be reported in the provider's own2024-04-18T09:16:18.5816873Z stdout: issue tracker.2024-04-18T09:16:18.5817224Z exit: 12024-04-18T09:16:18.5817296Z
Expected Behaviour
Terraform should exit with code 0, the following resources should be created in Azure and placed inside the terraform state.
Actual Behaviour
Error: Provider produced inconsistent result after apply
2024-04-18T09:16:18.5269378Z stdout:
2024-04-18T09:16:18.5269501Z stdout: When applying changes to
2024-04-18T09:16:18.5269987Z stdout: module.frontdoor["s00803NFD999991sltfm090728dev"].module.fdazurediagnostics[0].azurerm_monitor_diagnostic_setting.fdazurediagnostics[0],
2024-04-18T09:16:18.5270279Z stdout: provider "provider["registry.terraform.io/hashicorp/azurerm"]" produced an
2024-04-18T09:16:18.5270491Z stdout: unexpected new value: Root resource was present, but now absent.
2024-04-18T09:16:18.5270841Z stdout:
2024-04-18T09:16:18.5271133Z stdout: This is a bug in the provider, which should be reported in the provider's own
2024-04-18T09:16:18.5816873Z stdout: issue tracker.
2024-04-18T09:16:18.5817224Z exit: 1
2024-04-18T09:16:18.5817296Z
Steps to Reproduce
terraform plan and apply. We are seeing consistently this issue to trafficmanager and frontdoor, azure side it is created successfully
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Thanks for quick fix and we need to know when this fix will be available because this fix is really important for our product. Is there any can we prioritize the fix to megre.
Hi @raghavendra3553 , I am not sure if it is unstable API or other factor, I cannot repro the Root resource was present, but now absent. error for diagnostic setting in my local now. Can you or anyone help provide Terraform debug logs with HTTP logs about PUT diagnostic setting and GET diagnostic setting (I guess it should be 404 returned for the GET after PUT), so I can submit the issue to REST API as suggested in #25697 (review) and push this forward.
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.7
AzureRM Provider Version
3.85.0
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform should exit with code 0, the following resources should be created in Azure and placed inside the terraform state.
Actual Behaviour
Error: Provider produced inconsistent result after apply
2024-04-18T09:16:18.5269378Z stdout:
2024-04-18T09:16:18.5269501Z stdout: When applying changes to
2024-04-18T09:16:18.5269987Z stdout: module.frontdoor["s00803NFD999991sltfm090728dev"].module.fdazurediagnostics[0].azurerm_monitor_diagnostic_setting.fdazurediagnostics[0],
2024-04-18T09:16:18.5270279Z stdout: provider "provider["registry.terraform.io/hashicorp/azurerm"]" produced an
2024-04-18T09:16:18.5270491Z stdout: unexpected new value: Root resource was present, but now absent.
2024-04-18T09:16:18.5270841Z stdout:
2024-04-18T09:16:18.5271133Z stdout: This is a bug in the provider, which should be reported in the provider's own
2024-04-18T09:16:18.5816873Z stdout: issue tracker.
2024-04-18T09:16:18.5817224Z exit: 1
2024-04-18T09:16:18.5817296Z
Steps to Reproduce
terraform plan and apply. We are seeing consistently this issue to trafficmanager and frontdoor, azure side it is created successfully
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: