Skip to main content

account_storage_credentials

Creates, updates, deletes, gets or lists an account_storage_credentials resource.

Overview

Nameaccount_storage_credentials
TypeResource
Iddatabricks_account.catalog.account_storage_credentials

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the credential.
namestringThe credential name. The name must be unique among storage and service credentials within the metastore.
metastore_idstringUnique identifier of the parent metastore.
full_namestringThe full name of the credential.
aws_iam_roleobjectThe AWS IAM role configuration
azure_managed_identityobjectThe Azure managed identity configuration.
azure_service_principalobjectThe Azure service principal configuration.
cloudflare_api_tokenobjectThe Cloudflare API token configuration.
commentstringComment associated with the credential.
created_atintegerTime at which this credential was created, in epoch milliseconds.
created_bystringUsername of credential creator.
databricks_gcp_service_accountobjectThe Databricks managed GCP service account configuration.
isolation_modestringWhether the current securable is accessible from all workspaces or a specific set of workspaces. (ISOLATION_MODE_ISOLATED, ISOLATION_MODE_OPEN)
ownerstringUsername of current owner of credential.
read_onlybooleanWhether the credential is usable only for read operations. Only applicable when purpose is **STORAGE**.
updated_atintegerTime at which this credential was last modified, in epoch milliseconds.
updated_bystringUsername of user who last modified the credential.
used_for_managed_storagebooleanWhether this credential is the current metastore's root storage credential. Only applicable when purpose is **STORAGE**.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
account_storage_credentials_getselectaccount_id, metastore_id, storage_credential_nameGets a storage credential from the metastore. The caller must be a metastore admin, the owner of the
account_storage_credentials_listselectaccount_id, metastore_idGets a list of all storage credentials that have been assigned to given metastore.
account_storage_credentials_createinsertaccount_id, metastore_idCreates a new storage credential. The request object is specific to the cloud: - AwsIamRole for
account_storage_credentials_updatereplaceaccount_id, metastore_id, storage_credential_nameUpdates a storage credential on the metastore. The caller must be the owner of the storage credential.
account_storage_credentials_deletedeleteaccount_id, metastore_id, storage_credential_nameforceDeletes a storage credential from the metastore. The caller must be an owner of the storage

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_idstring
metastore_idstringUnity Catalog metastore ID
storage_credential_namestringName of the storage credential.
forcebooleanForce deletion even if the Storage Credential is not empty. Default is false.

SELECT examples

Gets a storage credential from the metastore. The caller must be a metastore admin, the owner of the

SELECT
id,
name,
metastore_id,
full_name,
aws_iam_role,
azure_managed_identity,
azure_service_principal,
cloudflare_api_token,
comment,
created_at,
created_by,
databricks_gcp_service_account,
isolation_mode,
owner,
read_only,
updated_at,
updated_by,
used_for_managed_storage
FROM databricks_account.catalog.account_storage_credentials
WHERE account_id = '{{ account_id }}' -- required
AND metastore_id = '{{ metastore_id }}' -- required
AND storage_credential_name = '{{ storage_credential_name }}' -- required
;

INSERT examples

Creates a new storage credential. The request object is specific to the cloud: - AwsIamRole for

INSERT INTO databricks_account.catalog.account_storage_credentials (
credential_info,
skip_validation,
account_id,
metastore_id
)
SELECT
'{{ credential_info }}',
{{ skip_validation }},
'{{ account_id }}',
'{{ metastore_id }}'
RETURNING
credential_info
;

REPLACE examples

Updates a storage credential on the metastore. The caller must be the owner of the storage credential.

REPLACE databricks_account.catalog.account_storage_credentials
SET
credential_info = '{{ credential_info }}',
skip_validation = {{ skip_validation }}
WHERE
account_id = '{{ account_id }}' --required
AND metastore_id = '{{ metastore_id }}' --required
AND storage_credential_name = '{{ storage_credential_name }}' --required
RETURNING
credential_info;

DELETE examples

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

DELETE FROM databricks_account.catalog.account_storage_credentials
WHERE account_id = '{{ account_id }}' --required
AND metastore_id = '{{ metastore_id }}' --required
AND storage_credential_name = '{{ storage_credential_name }}' --required
AND force = '{{ force }}'
;