credentials
Operations on a credentials
resource.
Overview
Name | credentials |
Type | Resource |
Id | databricks_workspace.unitycatalog.credentials |
Fields
Name | Datatype |
---|---|
aws_temp_credentials | object |
expiration_time | integer |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
generatetemporaryservicecredential | SELECT | deployment_name | Returns a set of temporary credentials generated using the specified service credential. The caller must be a metastore admin or have the metastore privilege |
getcredential | SELECT | name_arg, deployment_name | Gets a service or storage credential from the metastore. The caller must be a metastore admin, the owner of the credential, or have any permission on the credential. |
listcredentials | SELECT | deployment_name | Gets an array of credentials (as |
createcredential | INSERT | deployment_name | Creates a new credential. The type of credential to be created is determined by the |
deletecredential | DELETE | name_arg, deployment_name | Deletes a service or storage credential from the metastore. The caller must be an owner of the credential. |
updatecredential | UPDATE | name_arg, deployment_name | Updates a service or storage credential on the metastore. |
SELECT
examples
- credentials (generatetemporaryservicecredential)
- credentials (listcredentials)
- credentials (getcredential)
SELECT
aws_temp_credentials,
expiration_time
FROM databricks_workspace.unitycatalog.credentials
WHERE deployment_name = '{{ deployment_name }}';
SELECT
aws_temp_credentials,
expiration_time
FROM databricks_workspace.unitycatalog.credentials
WHERE deployment_name = '{{ deployment_name }}';
SELECT
aws_temp_credentials,
expiration_time
FROM databricks_workspace.unitycatalog.credentials
WHERE name_arg = '{{ name_arg }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new credentials
resource.
- credentials
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.credentials (
deployment_name,
data__name,
data__aws_iam_role,
data__comment,
data__read_only,
data__purpose,
data__skip_validation
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ aws_iam_role }}',
'{{ comment }}',
'{{ read_only }}',
'{{ purpose }}',
'{{ skip_validation }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: aws_iam_role
value:
role_arn: string
unity_catalog_iam_arn: string
external_id: string
- name: comment
value: string
- name: read_only
value: true
- name: purpose
value: STORAGE
- name: skip_validation
value: false
UPDATE
example
Updates a credentials
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.credentials
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name_arg = '{{ name_arg }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a credentials
resource.
/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.credentials
WHERE name_arg = '{{ name_arg }}' AND
deployment_name = '{{ deployment_name }}';