Skip to main content

storage_credentials

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

Overview

Namestorage_credentials
TypeResource
Iddatabricks_workspace.unitycatalog.storage_credentials

Fields

The following fields are returned by SELECT queries:

The storage credential was successfully retrieved.

NameDatatypeDescription
idstring
namestring
metastore_idstring
full_namestring
aws_iam_roleobject
commentstring
created_atinteger
created_bystring
isolation_modestring
ownerstring
read_onlyboolean
updated_atinteger
updated_bystring
used_for_managed_storageboolean

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets a storage credential from the metastore. The caller must be a metastore admin, the owner of the storage credential, or have some permission on the storage credential.
listselectdeployment_nameGets an array of storage credentials (as
createinsertdeployment_nameCreates a new storage credential.
updateupdatedeployment_nameUpdates a storage credential on the metastore.
deletedeletedeployment_nameDeletes a storage credential from the metastore. The caller must be an owner of the storage 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

Gets a storage credential from the metastore. The caller must be a metastore admin, the owner of the storage credential, or have some permission on the storage credential.

SELECT
id,
name,
metastore_id,
full_name,
aws_iam_role,
comment,
created_at,
created_by,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
used_for_managed_storage
FROM databricks_workspace.unitycatalog.storage_credentials
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new storage credential.

INSERT INTO databricks_workspace.unitycatalog.storage_credentials (
data__name,
data__comment,
data__read_only,
data__skip_validation,
data__aws_iam_role,
deployment_name
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ read_only }}',
{{ 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,
read_only,
updated_at,
updated_by,
used_for_managed_storage
;

UPDATE examples

Updates a storage credential on the metastore.

UPDATE databricks_workspace.unitycatalog.storage_credentials
SET
data__comment = '{{ comment }}',
data__read_only = {{ read_only }},
data__owner = '{{ owner }}',
data__isolation_mode = '{{ isolation_mode }}',
data__new_name = '{{ new_name }}',
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,
read_only,
updated_at,
updated_by,
used_for_managed_storage;

DELETE examples

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

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