Skip to main content

tag_policies

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

Overview

Nametag_policies
TypeResource
Iddatabricks_workspace.tags.tag_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
create_timestringTimestamp when the tag policy was created
descriptionstring
tag_keystring
update_timestringTimestamp when the tag policy was last updated
valuesarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttag_key, deployment_nameGets a single tag policy by its associated governed tag's key. For Terraform usage, see the [Tag
listselectdeployment_namepage_size, page_tokenLists the tag policies for all governed tags in the account. For Terraform usage, see the [Tag Policy
createinsertdeployment_name, tag_policyCreates a new tag policy, making the associated tag key governed. For Terraform usage, see the [Tag
updateupdatetag_key, update_mask, deployment_name, tag_policyUpdates an existing tag policy for a single governed tag. For Terraform usage, see the [Tag Policy
deletedeletetag_key, deployment_nameDeletes 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.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
tag_keystringstr
update_maskstringThe 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_sizeintegerThe 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_tokenstringAn optional page token received from a previous list tag policies call.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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
;