Skip to main content

credentials

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

Overview

Namecredentials
TypeResource
Iddatabricks_account.catalog.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.
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.
purposestringIndicates the purpose of the credential. (SERVICE, STORAGE)
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
get_credentialselectname_argGets a service or storage credential from the metastore. The caller must be a metastore admin, the
list_credentialsselectinclude_unbound, max_results, page_token, purposeGets an array of credentials (as CredentialInfo objects).
create_credentialinsertnameCreates a new credential. The type of credential to be created is determined by the purpose field,
credentials_generate_temporary_service_credentialinsertcredential_nameReturns a set of temporary credentials generated using the specified service credential. The caller
credentials_validate_credentialinsertValidates a credential.
update_credentialupdatename_argUpdates a service or storage credential on the metastore.
delete_credentialdeletename_argforceDeletes a service or storage credential from the metastore. The caller must be an owner of the

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
name_argstringName of the credential.
forcebooleanForce an update even if there are dependent services (when purpose is SERVICE) or dependent external locations and external tables (when purpose is STORAGE).
include_unboundbooleanWhether to include credentials not bound to the workspace. Effective only if the user has permission to update the credential–workspace binding.
max_resultsintegerMaximum number of credentials to return. - If not set, the default max page size is used. - When set to a value greater than 0, the page length is the minimum of this value and a server-configured value. - When set to 0, the page length is set to a server-configured value (recommended). - When set to a value less than 0, an invalid parameter error is returned.
page_tokenstringOpaque token to retrieve the next page of results.
purposestringReturn only credentials for the specified purpose.

SELECT examples

Gets a service or storage credential from the metastore. The caller must be a metastore admin, the

SELECT
id,
name,
metastore_id,
full_name,
aws_iam_role,
azure_managed_identity,
azure_service_principal,
comment,
created_at,
created_by,
databricks_gcp_service_account,
isolation_mode,
owner,
purpose,
read_only,
updated_at,
updated_by,
used_for_managed_storage
FROM databricks_account.catalog.credentials
WHERE name_arg = '{{ name_arg }}' -- required
;

INSERT examples

Creates a new credential. The type of credential to be created is determined by the purpose field,

INSERT INTO databricks_account.catalog.credentials (
name,
aws_iam_role,
azure_managed_identity,
azure_service_principal,
comment,
databricks_gcp_service_account,
purpose,
read_only,
skip_validation
)
SELECT
'{{ name }}' /* required */,
'{{ aws_iam_role }}',
'{{ azure_managed_identity }}',
'{{ azure_service_principal }}',
'{{ comment }}',
'{{ databricks_gcp_service_account }}',
'{{ purpose }}',
{{ read_only }},
{{ skip_validation }}
RETURNING
id,
name,
metastore_id,
full_name,
aws_iam_role,
azure_managed_identity,
azure_service_principal,
comment,
created_at,
created_by,
databricks_gcp_service_account,
isolation_mode,
owner,
purpose,
read_only,
updated_at,
updated_by,
used_for_managed_storage
;

UPDATE examples

Updates a service or storage credential on the metastore.

UPDATE databricks_account.catalog.credentials
SET
aws_iam_role = '{{ aws_iam_role }}',
azure_managed_identity = '{{ azure_managed_identity }}',
azure_service_principal = '{{ azure_service_principal }}',
comment = '{{ comment }}',
databricks_gcp_service_account = '{{ databricks_gcp_service_account }}',
force = {{ force }},
isolation_mode = '{{ isolation_mode }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}',
read_only = {{ read_only }},
skip_validation = {{ skip_validation }}
WHERE
name_arg = '{{ name_arg }}' --required
RETURNING
id,
name,
metastore_id,
full_name,
aws_iam_role,
azure_managed_identity,
azure_service_principal,
comment,
created_at,
created_by,
databricks_gcp_service_account,
isolation_mode,
owner,
purpose,
read_only,
updated_at,
updated_by,
used_for_managed_storage;

DELETE examples

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

DELETE FROM databricks_account.catalog.credentials
WHERE name_arg = '{{ name_arg }}' --required
AND force = '{{ force }}'
;