hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.65k forks source link

Support for flexible sql servers to enable audit logging #23742

Open Gitbo59 opened 1 year ago

Gitbo59 commented 1 year ago

Is there an existing issue for this?

Community Note

Description

currently the resource azurerm_mssql_server_extended_auditing_policy requires the server_id argument which takes the id of an sql server e.g. /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.DBforMySQL/servers/{server-name}

when using a flexible mysql server the id is exported as: /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.DBforMySQL/flexibleServers/{server-name}

when referencing the flexible server id in the auditing policy resource the error produced is 'ID was missing the 'servers' element'.

i cant seem to find any other 'proper' way of updating the audit policy of flexible sql servers

New or Affected Resource(s)/Data Source(s)

azurerm_mssql_server_extended_auditing_policy

Potential Terraform Configuration

resource "azurerm_mysql_flexible_server_auditing_policy" "example" { server_id = azurerm_mysql_flexible_server.example.id blob_storage_endpoint = azurerm_storage_account.example.primary_blob_endpoint storage_account_access_key = azurerm_storage_account.example.primary_access_key }

References

No response

Gitbo59 commented 4 weeks ago

Added potential terraform configuration