Skip to content

Commit

Permalink
Sleeeeeep is overrated
Browse files Browse the repository at this point in the history
  • Loading branch information
favoretti committed May 8, 2024
1 parent 1da6bd8 commit 6f09040
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions internal/services/databricks/databricks_workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,25 @@ func resourceDatabricksWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta int
encrypt.Entities.ManagedDisk.RotationToLatestKeyVersionEnabled = utils.Bool(rotationEnabled)
}

accessConnectorProperties := workspaces.WorkspacePropertiesAccessConnector{}
// Including the Tags in the workspace parameters will update the tags on
// the workspace only
workspace := workspaces.Workspace{
Sku: &workspaces.Sku{
Name: skuName,
},
Location: location,
Properties: workspaces.WorkspaceProperties{

PublicNetworkAccess: &publicNetworkAccess,
DefaultStorageFirewall: &defaultStorageFirewallEnabled,
ManagedResourceGroupId: managedResourceGroupID,
Parameters: customParams,
},
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
}

if defaultStorageFirewallEnabledRaw {
accessConnectorProperties := workspaces.WorkspacePropertiesAccessConnector{}
accessConnectorIdRaw := d.Get("access_connector_id").(string)
accessConnectorId, err := accessconnector.ParseAccessConnectorID(accessConnectorIdRaw)

Expand Down Expand Up @@ -614,23 +630,8 @@ func resourceDatabricksWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta int
accessConnectorProperties.IdentityType = workspaces.IdentityType(accessConnector.Model.Identity.Type)
accessConnectorProperties.UserAssignedIdentityId = &accIdentityId
}
}

// Including the Tags in the workspace parameters will update the tags on
// the workspace only
workspace := workspaces.Workspace{
Sku: &workspaces.Sku{
Name: skuName,
},
Location: location,
Properties: workspaces.WorkspaceProperties{
AccessConnector: &accessConnectorProperties,
PublicNetworkAccess: &publicNetworkAccess,
DefaultStorageFirewall: &defaultStorageFirewallEnabled,
ManagedResourceGroupId: managedResourceGroupID,
Parameters: customParams,
},
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
workspace.Properties.AccessConnector = &accessConnectorProperties
}

if requireNsgRules != "" {
Expand Down

0 comments on commit 6f09040

Please sign in to comment.