tag_policies
Creates, updates, deletes, gets or lists a tag_policies resource.
Overview
| Name | tag_policies |
| Type | Resource |
| Id | databricks_workspace.tags.tag_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | |
create_time | string | Timestamp when the tag policy was created |
description | string | |
tag_key | string | |
update_time | string | Timestamp when the tag policy was last updated |
values | array |
| Name | Datatype | Description |
|---|---|---|
id | string | |
create_time | string | Timestamp when the tag policy was created |
description | string | |
tag_key | string | |
update_time | string | Timestamp when the tag policy was last updated |
values | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | tag_key, deployment_name | Gets a single tag policy by its associated governed tag's key. For Terraform usage, see the [Tag | |
list | select | deployment_name | page_size, page_token | Lists the tag policies for all governed tags in the account. For Terraform usage, see the [Tag Policy |
create | insert | deployment_name, tag_policy | Creates a new tag policy, making the associated tag key governed. For Terraform usage, see the [Tag | |
update | update | tag_key, update_mask, deployment_name, tag_policy | Updates an existing tag policy for a single governed tag. For Terraform usage, see the [Tag Policy | |
delete | delete | tag_key, deployment_name | Deletes a tag policy by its associated governed tag's key, leaving that tag key ungoverned. For |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
tag_key | string | str |
update_mask | string | The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (.) to navigate sub-fields (e.g., author.given_name). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names. A field mask of * indicates full replacement. It’s recommended to always explicitly list the fields being updated and avoid using * wildcards, as it can lead to unintended results if the API changes in the future. |
page_size | integer | The maximum number of results to return in this request. Fewer results may be returned than requested. If unspecified or set to 0, this defaults to 1000. The maximum value is 1000; values above 1000 will be coerced down to 1000. |
page_token | string | An optional page token received from a previous list tag policies call. |
SELECT examples
- get
- list
Gets a single tag policy by its associated governed tag's key. For Terraform usage, see the [Tag
SELECT
id,
create_time,
description,
tag_key,
update_time,
values
FROM databricks_workspace.tags.tag_policies
WHERE tag_key = '{{ tag_key }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Lists the tag policies for all governed tags in the account. For Terraform usage, see the [Tag Policy
SELECT
id,
create_time,
description,
tag_key,
update_time,
values
FROM databricks_workspace.tags.tag_policies
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a new tag policy, making the associated tag key governed. For Terraform usage, see the [Tag
INSERT INTO databricks_workspace.tags.tag_policies (
tag_policy,
deployment_name
)
SELECT
'{{ tag_policy }}' /* required */,
'{{ deployment_name }}'
RETURNING
id,
create_time,
description,
tag_key,
update_time,
values
;
# Description fields are for documentation purposes
- name: tag_policies
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the tag_policies resource.
- name: tag_policy
description: |
:returns: :class:`TagPolicy`
value:
tag_key: "{{ tag_key }}"
create_time: "{{ create_time }}"
description: "{{ description }}"
id: "{{ id }}"
update_time: "{{ update_time }}"
values:
- name: "{{ name }}"
UPDATE examples
- update
Updates an existing tag policy for a single governed tag. For Terraform usage, see the [Tag Policy
UPDATE databricks_workspace.tags.tag_policies
SET
tag_policy = '{{ tag_policy }}'
WHERE
tag_key = '{{ tag_key }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND tag_policy = '{{ tag_policy }}' --required
RETURNING
id,
create_time,
description,
tag_key,
update_time,
values;
DELETE examples
- delete
Deletes a tag policy by its associated governed tag's key, leaving that tag key ungoverned. For
DELETE FROM databricks_workspace.tags.tag_policies
WHERE tag_key = '{{ tag_key }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;