Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_databricks_access_connector : support SystemAssigned, UserAssigned identity type #28442

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (r AccessConnectorResource) Arguments() map[string]*pluginsdk.Schema {

"resource_group_name": commonschema.ResourceGroupName(),

"identity": commonschema.SystemOrUserAssignedIdentityOptional(),
"identity": commonschema.SystemAssignedUserAssignedIdentityOptional(),

"tags": commonschema.Tags(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ func TestAccDatabricksAccessConnector_identityComplete(t *testing.T) {
),
},
data.ImportStep(),
{
Config: r.identitySystemAssignedUserAssigned(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down Expand Up @@ -185,6 +192,35 @@ resource "azurerm_databricks_access_connector" "test" {
`, template, data.RandomInteger)
}

func (r DatabricksAccessConnectorResource) identitySystemAssignedUserAssigned(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
provider "azurerm" {
features {}
}

%s

resource "azurerm_user_assigned_identity" "test" {
name = "acctestDBUAI-%[2]d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
}

resource "azurerm_databricks_access_connector" "test" {
name = "acctestDBAC%[2]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
identity {
type = "SystemAssigned, UserAssigned"
identity_ids = [
azurerm_user_assigned_identity.test.id,
]
}
}
`, template, data.RandomInteger)
}

func (r DatabricksAccessConnectorResource) basic(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/databricks_access_connector.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ In addition to the Arguments listed above - the following Attributes are exporte

An `identity` block supports the following:

* `type` - (Required) Specifies the type of Managed Service Identity that should be configured on the Databricks Access Connector. Possible values include `SystemAssigned` or `UserAssigned`.
* `type` - (Required) Specifies the type of Managed Service Identity that should be configured on the Databricks Access Connector. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned`.

* `identity_ids` - (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to the Databricks Access Connector. Only one User Assigned Managed Identity ID is supported per Databricks Access Connector resource.

Expand Down
Loading