databricks.ClusterPolicy
Explore with Pulumi AI
This resource creates a cluster policy, which limits the ability to create clusters based on a set of rules. The policy rules limit the attributes or attribute values available for cluster creation. cluster policies have ACLs that limit their use to specific users and groups. Only admin users can create, edit, and delete policies. Admin users also have access to all policies.
Cluster policies let you:
- Limit users to create clusters with prescribed settings.
- Simplify the user interface and enable more users to create their own clusters (by fixing and hiding some values).
- Control cost by limiting per cluster maximum cost (by setting limits on attributes whose values contribute to hourly price).
Cluster policy permissions limit which policies a user can select in the Policy drop-down when the user creates a cluster:
- If no policies have been created in the workspace, the Policy drop-down does not display.
- A user who has cluster create permission can select the
Free form
policy and create fully-configurable clusters. - A user who has both cluster create permission and access to cluster policies can select the Free form policy and policies they have access to.
- A user that has access to only cluster policies, can select the policies they have access to.
Related Resources
The following resources are often used in the same context:
- Dynamic Passthrough Clusters for a Group guide.
- End to end workspace management guide.
- databricks.getClusters data to retrieve a list of databricks.Cluster ids.
- databricks.Cluster to create Databricks Clusters.
- databricks.getCurrentUser data to retrieve information about databricks.User or databricks_service_principal, that is calling Databricks REST API.
- databricks.GlobalInitScript to manage global init scripts, which are run on all databricks.Cluster and databricks_job.
- databricks.InstancePool to manage instance pools to reduce cluster start and auto-scaling times by maintaining a set of idle, ready-to-use instances.
- databricks.InstanceProfile to manage AWS EC2 instance profiles that users can launch databricks.Cluster and access data, like databricks_mount.
- databricks.IpAccessList to allow access from predefined IP ranges.
- databricks.Library to install a library on databricks_cluster.
- databricks.getNodeType data to get the smallest node type for databricks.Cluster that fits search criteria, like amount of RAM or number of cores.
- databricks.Permissions to manage access control in Databricks workspace.
- databricks.getSparkVersion data to get Databricks Runtime (DBR) version that could be used for
spark_version
parameter in databricks.Cluster and other resources. - databricks.UserInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_user.
- databricks.WorkspaceConf to manage workspace configuration for expert usage.
Create ClusterPolicy Resource
new ClusterPolicy(name: string, args?: ClusterPolicyArgs, opts?: CustomResourceOptions);
@overload
def ClusterPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
definition: Optional[str] = None,
description: Optional[str] = None,
max_clusters_per_user: Optional[int] = None,
name: Optional[str] = None,
policy_family_definition_overrides: Optional[str] = None,
policy_family_id: Optional[str] = None)
@overload
def ClusterPolicy(resource_name: str,
args: Optional[ClusterPolicyArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewClusterPolicy(ctx *Context, name string, args *ClusterPolicyArgs, opts ...ResourceOption) (*ClusterPolicy, error)
public ClusterPolicy(string name, ClusterPolicyArgs? args = null, CustomResourceOptions? opts = null)
public ClusterPolicy(String name, ClusterPolicyArgs args)
public ClusterPolicy(String name, ClusterPolicyArgs args, CustomResourceOptions options)
type: databricks:ClusterPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClusterPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ClusterPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ClusterPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClusterPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClusterPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ClusterPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ClusterPolicy resource accepts the following input properties:
- Definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- Description string
Additional human-readable description of the cluster policy.
- Max
Clusters intPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- Name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- Policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- Policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
- Definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- Description string
Additional human-readable description of the cluster policy.
- Max
Clusters intPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- Name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- Policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- Policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
- definition String
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description String
Additional human-readable description of the cluster policy.
- max
Clusters IntegerPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name String
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family StringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family StringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
- definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description string
Additional human-readable description of the cluster policy.
- max
Clusters numberPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
- definition str
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description str
Additional human-readable description of the cluster policy.
- max_
clusters_ intper_ user Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name str
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy_
family_ strdefinition_ overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy_
family_ strid ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
- definition String
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description String
Additional human-readable description of the cluster policy.
- max
Clusters NumberPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name String
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family StringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family StringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.
Outputs
All input properties are implicitly available as output properties. Additionally, the ClusterPolicy resource produces the following output properties:
Look up Existing ClusterPolicy Resource
Get an existing ClusterPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ClusterPolicyState, opts?: CustomResourceOptions): ClusterPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
definition: Optional[str] = None,
description: Optional[str] = None,
max_clusters_per_user: Optional[int] = None,
name: Optional[str] = None,
policy_family_definition_overrides: Optional[str] = None,
policy_family_id: Optional[str] = None,
policy_id: Optional[str] = None) -> ClusterPolicy
func GetClusterPolicy(ctx *Context, name string, id IDInput, state *ClusterPolicyState, opts ...ResourceOption) (*ClusterPolicy, error)
public static ClusterPolicy Get(string name, Input<string> id, ClusterPolicyState? state, CustomResourceOptions? opts = null)
public static ClusterPolicy get(String name, Output<String> id, ClusterPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- Description string
Additional human-readable description of the cluster policy.
- Max
Clusters intPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- Name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- Policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- Policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- Policy
Id string Canonical unique identifier for the cluster policy.
- Definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- Description string
Additional human-readable description of the cluster policy.
- Max
Clusters intPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- Name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- Policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- Policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- Policy
Id string Canonical unique identifier for the cluster policy.
- definition String
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description String
Additional human-readable description of the cluster policy.
- max
Clusters IntegerPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name String
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family StringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family StringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- policy
Id String Canonical unique identifier for the cluster policy.
- definition string
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description string
Additional human-readable description of the cluster policy.
- max
Clusters numberPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name string
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family stringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family stringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- policy
Id string Canonical unique identifier for the cluster policy.
- definition str
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description str
Additional human-readable description of the cluster policy.
- max_
clusters_ intper_ user Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name str
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy_
family_ strdefinition_ overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy_
family_ strid ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- policy_
id str Canonical unique identifier for the cluster policy.
- definition String
Policy definition: JSON document expressed in Databricks Policy Definition Language. Cannot be used with
policy_family_id
- description String
Additional human-readable description of the cluster policy.
- max
Clusters NumberPer User Maximum number of clusters allowed per user. When omitted, there is no limit. If specified, value must be greater than zero.
- name String
Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
- policy
Family StringDefinition Overrides Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests. You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.
- policy
Family StringId ID of the policy family. The cluster policy's policy definition inherits the policy family's policy definition. Cannot be used with
definition
. Usepolicy_family_definition_overrides
instead to customize the policy definition.- policy
Id String Canonical unique identifier for the cluster policy.
Import
The resource cluster policy can be imported using the policy idbash
$ pulumi import databricks:index/clusterPolicy:ClusterPolicy this <cluster-policy-id>
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
databricks
Terraform Provider.