Skip to main content

workspace_assignment

Creates, updates, deletes, gets or lists a workspace_assignment resource.

Overview​

Nameworkspace_assignment
TypeResource
Iddatabricks_account.iam.workspace_assignment

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
errorstringError response associated with a workspace permission assignment, if any.
permissionsarrayThe permissions level of the principal.
â–¶principalobjectInformation about the principal assigned to the workspace.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
workspace_assignment_listselectaccount_id, workspace_id, account_hostGet the permission assignments for the specified Databricks account and Databricks workspace.
workspace_assignment_updatereplaceaccount_id, workspace_id, principal_id, account_hostCreates or updates the workspace permissions assignment in a given account and workspace for the
workspace_assignment_deletedeleteaccount_id, workspace_id, principal_id, account_hostDeletes the workspace permissions assignment in a given account and workspace for the specified

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_hoststringThe Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}})
account_idstring
principal_idintegerThe ID of the user, service principal, or group.
workspace_idintegerThe workspace ID for the account.

SELECT examples​

Get the permission assignments for the specified Databricks account and Databricks workspace.

SELECT
error,
permissions,
principal
FROM databricks_account.iam.workspace_assignment
WHERE account_id = '{{ account_id }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND account_host = '{{ account_host }}' -- required
;

REPLACE examples​

Creates or updates the workspace permissions assignment in a given account and workspace for the

REPLACE databricks_account.iam.workspace_assignment
SET
permissions = '{{ permissions }}'
WHERE
account_id = '{{ account_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND principal_id = '{{ principal_id }}' --required
AND account_host = '{{ account_host }}' --required
RETURNING
error,
permissions,
principal;

DELETE examples​

Deletes the workspace permissions assignment in a given account and workspace for the specified

DELETE FROM databricks_account.iam.workspace_assignment
WHERE account_id = '{{ account_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND principal_id = '{{ principal_id }}' --required
AND account_host = '{{ account_host }}' --required
;