Skip to main content

storage_credentials

Operations on a storage_credentials resource.

Overview

Namestorage_credentials
TypeResource
Iddatabricks_account.unity_catalog.storage_credentials

Fields

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

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccount_id, metastore_id, storage_credential_nameGets a storage credential from the metastore. The caller must be a metastore admin, the owner of the storage credential, or have a level of privilege on the storage credential.
listSELECTaccount_id, metastore_idGets a list of all storage credentials that have been assigned to given metastore.
createINSERTaccount_id, metastore_idCreates a new storage credential. The request object is specific to the cloud:
deleteDELETEaccount_id, metastore_id, storage_credential_nameDeletes a storage credential from the metastore. The caller must be an owner of the storage credential.
updateREPLACEaccount_id, metastore_id, storage_credential_nameUpdates a storage credential on the metastore. The caller must be the owner of the storage credential. If the caller is a metastore admin, only the

SELECT examples

SELECT
id,
name,
aws_iam_role,
comment,
created_at,
created_by,
full_name,
isolation_mode,
metastore_id,
owner,
read_only,
updated_at,
updated_by,
used_for_managed_storage
FROM databricks_account.unity_catalog.storage_credentials
WHERE account_id = '{{ account_id }}' AND
metastore_id = '{{ metastore_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new storage_credentials resource.

/*+ create */
INSERT INTO databricks_account.unity_catalog.storage_credentials (
account_id,
metastore_id,
data__credential_info
)
SELECT
'{{ account_id }}',
'{{ metastore_id }}',
'{{ credential_info }}'
;

REPLACE example

Replaces a storage_credentials resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.unity_catalog.storage_credentials
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
metastore_id = '{{ metastore_id }}' AND
storage_credential_name = '{{ storage_credential_name }}';

DELETE example

Deletes a storage_credentials resource.

/*+ delete */
DELETE FROM databricks_account.unity_catalog.storage_credentials
WHERE account_id = '{{ account_id }}' AND
metastore_id = '{{ metastore_id }}' AND
storage_credential_name = '{{ storage_credential_name }}';