1. Packages
  2. Databricks Provider
  3. API Docs
  4. ClusterPolicy
Viewing docs for Databricks v0.4.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
databricks logo
Viewing docs for Databricks v0.4.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    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.

    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

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClusterPolicy(name: string, args?: ClusterPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterPolicy(resource_name: str,
                      args: Optional[ClusterPolicyArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      definition: Optional[str] = None,
                      name: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var clusterPolicyResource = new Databricks.ClusterPolicy("clusterPolicyResource", new()
    {
        Definition = "string",
        Name = "string",
    });
    
    example, err := databricks.NewClusterPolicy(ctx, "clusterPolicyResource", &databricks.ClusterPolicyArgs{
    	Definition: pulumi.String("string"),
    	Name:       pulumi.String("string"),
    })
    
    var clusterPolicyResource = new ClusterPolicy("clusterPolicyResource", ClusterPolicyArgs.builder()
        .definition("string")
        .name("string")
        .build());
    
    cluster_policy_resource = databricks.ClusterPolicy("clusterPolicyResource",
        definition="string",
        name="string")
    
    const clusterPolicyResource = new databricks.ClusterPolicy("clusterPolicyResource", {
        definition: "string",
        name: "string",
    });
    
    type: databricks:ClusterPolicy
    properties:
        definition: string
        name: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ClusterPolicy resource accepts the following input properties:

    Definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    Name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    Definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    Name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    definition String
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name String
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    definition str
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name str
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    definition String
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name String
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClusterPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyId string
    Canonical unique identifier for the cluster policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyId string
    Canonical unique identifier for the cluster policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyId String
    Canonical unique identifier for the cluster policy.
    id string
    The provider-assigned unique ID for this managed resource.
    policyId string
    Canonical unique identifier for the cluster policy.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_id str
    Canonical unique identifier for the cluster policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyId String
    Canonical unique identifier for the cluster policy.

    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,
            name: 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)
    resources:  _:    type: databricks:ClusterPolicy    get:      id: ${id}
    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.
    The following state arguments are supported:
    Definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    Name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    PolicyId string
    Canonical unique identifier for the cluster policy.
    Definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    Name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    PolicyId string
    Canonical unique identifier for the cluster policy.
    definition String
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name String
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    policyId String
    Canonical unique identifier for the cluster policy.
    definition string
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name string
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    policyId string
    Canonical unique identifier for the cluster policy.
    definition str
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name str
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    policy_id str
    Canonical unique identifier for the cluster policy.
    definition String
    Policy definition JSON document expressed in Databricks Policy Definition Language.
    name String
    Cluster policy name. This must be unique. Length must be between 1 and 100 characters.
    policyId 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>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Viewing docs for Databricks v0.4.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.