Skip to main content

vw_account_storage_credentials

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

Overview

Namevw_account_storage_credentials
TypeView
Iddatabricks_account.catalog.vw_account_storage_credentials

Fields

The following fields are returned by this view:

NameDatatypeDescription
account_idstringDatabricks account ID used to scope the query.
metastore_idstringMetastore ID used to scope the query.
idstringUnique identifier for the storage credential.
namestringName of the storage credential.
full_namestringFully qualified name of the storage credential.
ownerstringUsername or group that owns the storage credential.
read_onlybooleanWhether the storage credential is restricted to read-only access.
used_for_managed_storagebooleanWhether this credential is used for managed storage in the metastore.
isolation_modestringIsolation mode controlling which workspaces can use this credential.
created_atintegerUnix timestamp (ms) when the credential was created.
created_bystringIdentity that created the storage credential.
updated_atintegerUnix timestamp (ms) when the credential was last updated.
updated_bystringIdentity that last updated the storage credential.
commentstringOptional free-text comment describing the storage credential.
aws_role_arnstringARN of the AWS IAM role used for credential (AWS only).
aws_external_idstringExternal ID used when assuming the AWS IAM role (AWS only).
aws_unity_catalog_iam_arnstringARN of the Unity Catalog IAM role for the AWS credential (AWS only).
azure_access_connector_idstringResource ID of the Azure Databricks Access Connector (Azure managed identity only).
azure_credential_idstringCredential ID for the Azure managed identity (Azure managed identity only).
azure_managed_identity_idstringID of the Azure managed identity (Azure managed identity only).
azure_directory_idstringAzure Active Directory tenant ID for the service principal (Azure service principal only).
azure_application_idstringApplication (client) ID of the Azure service principal (Azure service principal only).
cloudflare_access_key_idstringAccess key ID for the Cloudflare API token credential (Cloudflare only).
cloudflare_account_idstringCloudflare account ID associated with the API token credential (Cloudflare only).
gcp_credential_idstringCredential ID for the Databricks GCP service account (GCP only).
gcp_service_account_emailstringEmail address of the Databricks-managed GCP service account (GCP only).
cloud_typestringDerived cloud provider type - one of AWS, AZURE_MANAGED_IDENTITY, AZURE_SERVICE_PRINCIPAL, CLOUDFLARE, GCP, or UNKNOWN.

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
account_idstringDatabricks account ID used to scope the query.
metastore_idstringMetastore ID used to scope the query.

SELECT Examples

SELECT
account_id,
metastore_id,
id,
name,
full_name,
owner,
read_only,
used_for_managed_storage,
isolation_mode,
created_at,
created_by,
updated_at,
updated_by,
comment,
aws_role_arn,
aws_external_id,
aws_unity_catalog_iam_arn,
azure_access_connector_id,
azure_credential_id,
azure_managed_identity_id,
azure_directory_id,
azure_application_id,
cloudflare_access_key_id,
cloudflare_account_id,
gcp_credential_id,
gcp_service_account_email,
cloud_type
FROM databricks_account.catalog.vw_account_storage_credentials
WHERE account_id = '{{ account_id }}'
AND metastore_id = '{{ metastore_id }}';

SQL Definition

SELECT
sc.account_id,
sc.metastore_id,
sc.id,
sc.name,
sc.full_name,
sc.owner,
sc.read_only,
sc.used_for_managed_storage,
sc.isolation_mode,
sc.created_at,
sc.created_by,
sc.updated_at,
sc.updated_by,
sc.comment,
JSON_EXTRACT(sc.aws_iam_role, '$.role_arn') AS aws_role_arn,
JSON_EXTRACT(sc.aws_iam_role, '$.external_id') AS aws_external_id,
JSON_EXTRACT(sc.aws_iam_role, '$.unity_catalog_iam_arn') AS aws_unity_catalog_iam_arn,
JSON_EXTRACT(sc.azure_managed_identity, '$.access_connector_id') AS azure_access_connector_id,
JSON_EXTRACT(sc.azure_managed_identity, '$.credential_id') AS azure_credential_id,
JSON_EXTRACT(sc.azure_managed_identity, '$.managed_identity_id') AS azure_managed_identity_id,
JSON_EXTRACT(sc.azure_service_principal, '$.directory_id') AS azure_directory_id,
JSON_EXTRACT(sc.azure_service_principal, '$.application_id') AS azure_application_id,
JSON_EXTRACT(sc.cloudflare_api_token, '$.access_key_id') AS cloudflare_access_key_id,
JSON_EXTRACT(sc.cloudflare_api_token, '$.account_id') AS cloudflare_account_id,
JSON_EXTRACT(sc.databricks_gcp_service_account, '$.credential_id') AS gcp_credential_id,
JSON_EXTRACT(sc.databricks_gcp_service_account, '$.email') AS gcp_service_account_email,
CASE
WHEN sc.aws_iam_role IS NOT NULL THEN 'AWS'
WHEN sc.azure_managed_identity IS NOT NULL THEN 'AZURE_MANAGED_IDENTITY'
WHEN sc.azure_service_principal IS NOT NULL THEN 'AZURE_SERVICE_PRINCIPAL'
WHEN sc.cloudflare_api_token IS NOT NULL THEN 'CLOUDFLARE'
WHEN sc.databricks_gcp_service_account IS NOT NULL THEN 'GCP'
ELSE 'UNKNOWN'
END AS cloud_type
FROM databricks_account.catalog.account_storage_credentials sc
WHERE account_id = '{{ account_id }}'
AND metastore_id = '{{ metastore_id }}'