secrets
Operations on a secrets
resource.
Overview
Name | secrets |
Type | Resource |
Id | databricks_workspace.secrets.secrets |
Fields
Name | Datatype |
---|---|
key | string |
last_updated_timestamp | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
getsecret | SELECT | key, scope, deployment_name | Gets the bytes representation of a secret value for the specified scope and key. |
listsecrets | SELECT | scope, deployment_name | Lists the secret keys that are stored at this scope. This is a metadata-only operation; secret data cannot be retrieved using this API. Users need the READ permission to make this call. |
deletesecret | DELETE | deployment_name | Deletes the secret stored in this secret scope. You must have |
putsecret | REPLACE | deployment_name | Inserts a secret under the provided scope with the given name. If a secret already exists with the same name, this command overwrites the existing secret's value. The server encrypts the secret using the secret scope's encryption settings before storing it. |
SELECT
examples
- secrets (listsecrets)
- secrets (getsecret)
SELECT
key,
last_updated_timestamp
FROM databricks_workspace.secrets.secrets
WHERE scope = '{{ scope }}' AND
deployment_name = '{{ deployment_name }}';
SELECT
key,
last_updated_timestamp
FROM databricks_workspace.secrets.secrets
WHERE key = '{{ key }}' AND
scope = '{{ scope }}' AND
deployment_name = '{{ deployment_name }}';
REPLACE
example
Replaces a secrets
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_workspace.secrets.secrets
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a secrets
resource.
/*+ delete */
DELETE FROM databricks_workspace.secrets.secrets
WHERE deployment_name = '{{ deployment_name }}';