Skip to main content

storage_credentials

Operations on a storage_credentials resource.

Overview

Namestorage_credentials
TypeResource
Iddatabricks_workspace.unitycatalog.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
getSELECTname, deployment_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.
deleteDELETEname, deployment_nameDeletes a storage credential from the metastore. The caller must be an owner of the storage credential.
updateUPDATEname, deployment_nameUpdates a storage credential on the metastore.

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_workspace.unitycatalog.storage_credentials
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.storage_credentials (
deployment_name,
data__name,
data__comment,
data__read_only,
data__aws_iam_role,
data__skip_validation
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ comment }}',
'{{ read_only }}',
'{{ aws_iam_role }}',
'{{ skip_validation }}'
;

UPDATE example

Updates a storage_credentials resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.storage_credentials
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a storage_credentials resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.storage_credentials
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';