Skip to main content

credentials

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

Overview

Namecredentials
TypeResource
Iddatabricks_workspace.unitycatalog.credentials

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
aws_temp_credentialsobject
expiration_timeinteger

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
generatetemporaryservicecredentialselectdeployment_nameReturns a set of temporary credentials generated using the specified service credential. The caller must be a metastore admin or have the metastore privilege
getcredentialselectdeployment_nameGets a service or storage credential from the metastore. The caller must be a metastore admin, the owner of the credential, or have any permission on the credential.
listcredentialsselectdeployment_nameGets an array of credentials (as
createcredentialinsertdeployment_nameCreates a new credential. The type of credential to be created is determined by the
updatecredentialupdatedeployment_nameUpdates a service or storage credential on the metastore.
deletecredentialdeletedeployment_nameDeletes a service or storage credential from the metastore. The caller must be an owner of the credential.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Returns a set of temporary credentials generated using the specified service credential. The caller must be a metastore admin or have the metastore privilege

SELECT
aws_temp_credentials,
expiration_time
FROM databricks_workspace.unitycatalog.credentials
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new credential. The type of credential to be created is determined by the

INSERT INTO databricks_workspace.unitycatalog.credentials (
data__name,
data__comment,
data__read_only,
data__purpose,
data__skip_validation,
data__aws_iam_role,
deployment_name
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ read_only }}',
{{ purpose }},
'{{ skip_validation }}',
'{{ aws_iam_role }}',
'{{ deployment_name }}'
RETURNING
id,
name,
metastore_id,
full_name,
aws_iam_role,
comment,
created_at,
created_by,
isolation_mode,
owner,
purpose,
read_only,
updated_at,
updated_by,
used_for_managed_storage
;

UPDATE examples

Updates a service or storage credential on the metastore.

UPDATE databricks_workspace.unitycatalog.credentials
SET
data__new_name = '{{ new_name }}',
data__comment = '{{ comment }}',
data__read_only = {{ read_only }},
data__owner = '{{ owner }}',
data__isolation_mode = '{{ isolation_mode }}',
data__skip_validation = {{ skip_validation }},
data__force = {{ force }},
data__aws_iam_role = '{{ aws_iam_role }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
id,
name,
metastore_id,
full_name,
aws_iam_role,
comment,
created_at,
created_by,
isolation_mode,
owner,
purpose,
read_only,
updated_at,
updated_by,
used_for_managed_storage;

DELETE examples

Deletes a service or storage credential from the metastore. The caller must be an owner of the credential.

DELETE FROM databricks_workspace.unitycatalog.credentials
WHERE deployment_name = '{{ deployment_name }}' --required;