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.52k stars 4.6k forks source link

Support for both SystemAssigned and UserAssigned managed identities in azurerm_mssql_managed_instance #19802

Open tsfto opened 1 year ago

tsfto commented 1 year ago

Is there an existing issue for this?

Community Note

Description

The azurerm_mssql_managed_instance (azurerm_mssql_managed_instance) identity.type accepts either SystemAssigned OR UserAssigned values but NOT both at the same time. I would expect it to accept both managed identity types in a form of identity.type = SystemAssigned, UserAssigned so that both of them are created simultaneously for a particular instance of Azure SQL Server. I want to be able to create a SQL Server instance with the following managed identities:

0..1 System Assigned Managed Identity 0..n User Assigned Managed Identities

This is the same as Support for both SystemAssigned and UserAssigned managed identities in azurerm_mssql_server, but for SQL MI

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

azurerm_mssql_managed_instance

Potential Terraform Configuration

identity {
  type = "SystemAssigned,UserAssigned"
  identity_ids = ["id1", "id2"]
}

primary_user_assigned_identity_id = "id1"

References

https://github.com/hashicorp/terraform-provider-azurerm/issues/17199

djr747 commented 6 months ago

Since late 2022 the version of the Go SDK used by azurerm_mssql_managed_instance has supported supplying SystemAssigned,UserAssigned into IdentityType this should now be unblocked.

References https://pkg.go.dev/github.com/Azure/azure-sdk-for-go@v68.0.0+incompatible/services/preview/sql/mgmt/v5.0/sql#IdentityType

risticmarko commented 2 weeks ago

Since late 2022 the version of the Go SDK used by azurerm_mssql_managed_instance has supported supplying SystemAssigned,UserAssigned into IdentityType this should now be unblocked.

References https://pkg.go.dev/github.com/Azure/azure-sdk-for-go@v68.0.0+incompatible/services/preview/sql/mgmt/v5.0/sql#IdentityType

No that is not working expected identity.0.type to be one of ["UserAssigned" "SystemAssigned"], got SystemAssigned,UserAssigned