policy_compliance_for_clusters
Creates, updates, deletes, gets or lists a policy_compliance_for_clusters resource.
Overview
| Name | policy_compliance_for_clusters |
| Type | Resource |
| Id | databricks_workspace.compute.policy_compliance_for_clusters |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
is_compliant | boolean | |
violations | object | An 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. |
| Name | Datatype | Description |
|---|---|---|
cluster_id | string | |
is_compliant | boolean | Whether this cluster is in compliance with the latest version of its policy. |
violations | object | An 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | cluster_id, deployment_name | Returns the policy compliance status of a cluster. Clusters could be out of compliance if their policy | |
list | select | policy_id, deployment_name | page_size, page_token | Returns the policy compliance status of all clusters that use a given policy. Clusters could be out of |
enforce | insert | deployment_name, cluster_id | Updates 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.
| Name | Datatype | Description |
|---|---|---|
cluster_id | string | The ID of the cluster to get the compliance status |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
policy_id | string | Canonical unique identifier for the cluster policy. |
page_size | integer | Use 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_token | string | A 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
- get
- list
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
;
Returns the policy compliance status of all clusters that use a given policy. Clusters could be out of
SELECT
cluster_id,
is_compliant,
violations
FROM databricks_workspace.compute.policy_compliance_for_clusters
WHERE policy_id = '{{ policy_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- enforce
- Manifest
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
;
# Description fields are for documentation purposes
- name: policy_compliance_for_clusters
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the policy_compliance_for_clusters resource.
- name: cluster_id
value: "{{ cluster_id }}"
description: |
The ID of the cluster you want to enforce policy compliance on.
- name: validate_only
value: {{ validate_only }}
description: |
If set, previews the changes that would be made to a cluster to enforce compliance but does not update the cluster.