Skip to main content

policy_compliance_for_clusters

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

Overview

Namepolicy_compliance_for_clusters
TypeResource
Iddatabricks_workspace.compute.policy_compliance_for_clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
is_compliantboolean
violationsobjectAn object containing key-value mappings representing the first 200 policy validation errors. The keys indicate the path where the policy validation error is occurring. The values indicate an error message describing the policy validation error.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, deployment_nameReturns the policy compliance status of a cluster. Clusters could be out of compliance if their policy
listselectpolicy_id, deployment_namepage_size, page_tokenReturns the policy compliance status of all clusters that use a given policy. Clusters could be out of
enforceinsertdeployment_name, cluster_idUpdates a cluster to be compliant with the current version of its policy. A cluster can be updated if

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
cluster_idstringThe ID of the cluster to get the compliance status
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
policy_idstringCanonical unique identifier for the cluster policy.
page_sizeintegerUse this field to specify the maximum number of results to be returned by the server. The server may further constrain the maximum number of results returned in a single page.
page_tokenstringA page token that can be used to navigate to the next page or previous page as returned by next_page_token or prev_page_token.

SELECT examples

Returns the policy compliance status of a cluster. Clusters could be out of compliance if their policy

SELECT
is_compliant,
violations
FROM databricks_workspace.compute.policy_compliance_for_clusters
WHERE cluster_id = '{{ cluster_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Updates a cluster to be compliant with the current version of its policy. A cluster can be updated if

INSERT INTO databricks_workspace.compute.policy_compliance_for_clusters (
cluster_id,
validate_only,
deployment_name
)
SELECT
'{{ cluster_id }}' /* required */,
{{ validate_only }},
'{{ deployment_name }}'
RETURNING
changes,
has_changes
;