storage_credentials
Operations on a storage_credentials
resource.
Overview
Name | storage_credentials |
Type | Resource |
Id | databricks_workspace.unitycatalog.storage_credentials |
Fields
Name | Datatype |
---|---|
id | string |
name | string |
aws_iam_role | object |
comment | string |
created_at | integer |
created_by | string |
full_name | string |
isolation_mode | string |
metastore_id | string |
owner | string |
read_only | boolean |
updated_at | integer |
updated_by | string |
used_for_managed_storage | boolean |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name, deployment_name | Gets 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. |
list | SELECT | deployment_name | Gets an array of storage credentials (as |
create | INSERT | deployment_name | Creates a new storage credential. |
delete | DELETE | name, deployment_name | Deletes a storage credential from the metastore. The caller must be an owner of the storage credential. |
update | UPDATE | name, deployment_name | Updates a storage credential on the metastore. |
SELECT
examples
- storage_credentials (list)
- storage_credentials (get)
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 }}';
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 name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new storage_credentials
resource.
- storage_credentials
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: comment
value: string
- name: read_only
value: true
- name: aws_iam_role
value:
role_arn: string
- name: skip_validation
value: false
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 }}';