Open dkirrane opened 3 years ago
Yes, I see the same issue. Previously it worked fine, not sure from which version it broke.
@tao-zhang-shell Don't know if helpful, but we're also seeing this with hashicorp/azurerm v2.98.0
Still seeing this with latest:
terraform {
required_version = "1.2.9"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.24.0"
}
}
}
Same is happening with 3.29. TF_LOG=DEBUG shows that I'm setting this in PUT:
{"disabledAlerts":[],"emailAccountAdmins":false,"emailAddresses":[],"retentionDays":0,"state":"Enabled"}
And I'm getting this in response. Therefore there's a difference between request and response for disabledAlerts and emailAddresses.
{"state":"Enabled","disabledAlerts":[""],"emailAddresses":[""],"emailAccountAdmins":false,"storageEndpoint":"","storageAccountAccessKey":"","retentionDays":0,"creationTime":"2022-11-13T07:13:14.427Z"}
Therefore I assumed that I may set [""] for disabledAlerts and emailAddresses to stop this. Unfortunately I get below error when I'm trying to do that:
Error: expected threat_detection_policy.0.disabled_alerts.0 to be one of [Sql_Injection Sql_Injection_Vulnerability Access_Anomaly Data_Exfiltration Unsafe_Action]
Community Note
Terraform (and AzureRM Provider) Version
Terraform v1.0.8
Affected Resource(s)
azurerm_v2.79.1
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
idempotency
Actual Behaviour
Set to true or false the terraform threat_detection_policy is not idempotent. Resource plan also shows a changes for no reason, in the
threat_detection_policy
.References
It looks like this issue was previously fixed. But I'm using latest provider version and still hit it.