Closed MelleD closed 3 years ago
Hi @MelleD, in the documentation this is already explained:
The Server Extended Auditing Policy Can be set inline here as well as with the mssql_server_extended_auditing_policy resource resource. You can only use one or the other and using both will cause a conflict.
When both the inline removal and the creation of the new resource is done in the same run, this causes conflict. I believe this is the problem you are facing here, could that be possible?
It's not that big of a deal, but could you please close your older issues or limit your journey to one issue, to improve handling a bit? Thanks in advance!
Yes that's the issue. Then i will try it with 2 runs, good option. Thanks :)
@aristosvo it's not working: The first run don't destroy/remove the inline block. I removed the inline block:
"No changes. Your infrastructure matches the configuration.",
"",
"Terraform has compared your real infrastructure against your configuration",
"and found no differences, so no changes are needed."
Sorry! Can you try extended_auditing_policy = []
/extended_auditing_policy []
? This should signal it should remove the setting at all. I'm not behind my desk so don't know which of the two it is, but one of these should work😬
Ok let's try :)
extended_auditing_policy = []
is working. 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
2.82.0
Affected Resource(s)
azurerm_mssql_server
azurerm_mssql_server_extended_auditing_policy
Terraform Configuration Files
Try to migrate from
to
Expected Behaviour
Inline block is removed and new resource is created.
Actual Behaviour
Inline block have to removed manually in state file.
see https://github.com/hashicorp/terraform-provider-azurerm/issues/9170
/extendedAuditingSettings/Default\" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for \"azurerm_mssql_server_extended_auditing_policy\"