1. Packages
  2. Databricks Provider
  3. API Docs
  4. BudgetPolicy
Databricks v1.63.0 published on Thursday, Mar 13, 2025 by Pulumi

databricks.BudgetPolicy

Explore with Pulumi AI

databricks logo
Databricks v1.63.0 published on Thursday, Mar 13, 2025 by Pulumi

    Administrators can use budget policies to ensure that the correct tags appear automatically on serverless resources without depending on users to attach tags manually, allowing for customized cost reporting and chargebacks. Budget policies consist of tags that are applied to any serverless compute activity incurred by a user assigned to the policy. The tags are logged in your billing records, allowing you to attribute serverless usage to specific budgets.

    This resource can only be used with an account-level provider!

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const _this = new databricks.BudgetPolicy("this", {
        policyName: "my-budget-policy",
        customTags: [{
            key: "mykey",
            value: "myvalue",
        }],
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    this = databricks.BudgetPolicy("this",
        policy_name="my-budget-policy",
        custom_tags=[{
            "key": "mykey",
            "value": "myvalue",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := databricks.NewBudgetPolicy(ctx, "this", &databricks.BudgetPolicyArgs{
    			PolicyName: pulumi.String("my-budget-policy"),
    			CustomTags: databricks.BudgetPolicyCustomTagArray{
    				&databricks.BudgetPolicyCustomTagArgs{
    					Key:   pulumi.String("mykey"),
    					Value: pulumi.String("myvalue"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Databricks.BudgetPolicy("this", new()
        {
            PolicyName = "my-budget-policy",
            CustomTags = new[]
            {
                new Databricks.Inputs.BudgetPolicyCustomTagArgs
                {
                    Key = "mykey",
                    Value = "myvalue",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.BudgetPolicy;
    import com.pulumi.databricks.BudgetPolicyArgs;
    import com.pulumi.databricks.inputs.BudgetPolicyCustomTagArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var this_ = new BudgetPolicy("this", BudgetPolicyArgs.builder()
                .policyName("my-budget-policy")
                .customTags(BudgetPolicyCustomTagArgs.builder()
                    .key("mykey")
                    .value("myvalue")
                    .build())
                .build());
    
        }
    }
    
    resources:
      this:
        type: databricks:BudgetPolicy
        properties:
          policyName: my-budget-policy
          customTags:
            - key: mykey
              value: myvalue
    

    Access Control

    • databricks.AccessControlRuleSet can control which groups or individual users can manage or use the given budget policy.

    Create BudgetPolicy Resource

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

    Constructor syntax

    new BudgetPolicy(name: string, args?: BudgetPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def BudgetPolicy(resource_name: str,
                     args: Optional[BudgetPolicyArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BudgetPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     custom_tags: Optional[Sequence[BudgetPolicyCustomTagArgs]] = None,
                     policy_name: Optional[str] = None)
    func NewBudgetPolicy(ctx *Context, name string, args *BudgetPolicyArgs, opts ...ResourceOption) (*BudgetPolicy, error)
    public BudgetPolicy(string name, BudgetPolicyArgs? args = null, CustomResourceOptions? opts = null)
    public BudgetPolicy(String name, BudgetPolicyArgs args)
    public BudgetPolicy(String name, BudgetPolicyArgs args, CustomResourceOptions options)
    
    type: databricks:BudgetPolicy
    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 BudgetPolicyArgs
    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 BudgetPolicyArgs
    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 BudgetPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BudgetPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BudgetPolicyArgs
    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 budgetPolicyResource = new Databricks.BudgetPolicy("budgetPolicyResource", new()
    {
        CustomTags = new[]
        {
            new Databricks.Inputs.BudgetPolicyCustomTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
        PolicyName = "string",
    });
    
    example, err := databricks.NewBudgetPolicy(ctx, "budgetPolicyResource", &databricks.BudgetPolicyArgs{
    	CustomTags: databricks.BudgetPolicyCustomTagArray{
    		&databricks.BudgetPolicyCustomTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	PolicyName: pulumi.String("string"),
    })
    
    var budgetPolicyResource = new BudgetPolicy("budgetPolicyResource", BudgetPolicyArgs.builder()
        .customTags(BudgetPolicyCustomTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .policyName("string")
        .build());
    
    budget_policy_resource = databricks.BudgetPolicy("budgetPolicyResource",
        custom_tags=[{
            "key": "string",
            "value": "string",
        }],
        policy_name="string")
    
    const budgetPolicyResource = new databricks.BudgetPolicy("budgetPolicyResource", {
        customTags: [{
            key: "string",
            value: "string",
        }],
        policyName: "string",
    });
    
    type: databricks:BudgetPolicy
    properties:
        customTags:
            - key: string
              value: string
        policyName: string
    

    BudgetPolicy 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 BudgetPolicy resource accepts the following input properties:

    CustomTags List<BudgetPolicyCustomTag>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    PolicyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    CustomTags []BudgetPolicyCustomTagArgs
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    PolicyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags List<BudgetPolicyCustomTag>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyName String
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags BudgetPolicyCustomTag[]
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    custom_tags Sequence[BudgetPolicyCustomTagArgs]
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policy_name str
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags List<Property Map>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyName String
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.

    Outputs

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

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

    Look up Existing BudgetPolicy Resource

    Get an existing BudgetPolicy 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?: BudgetPolicyState, opts?: CustomResourceOptions): BudgetPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            custom_tags: Optional[Sequence[BudgetPolicyCustomTagArgs]] = None,
            policy_id: Optional[str] = None,
            policy_name: Optional[str] = None) -> BudgetPolicy
    func GetBudgetPolicy(ctx *Context, name string, id IDInput, state *BudgetPolicyState, opts ...ResourceOption) (*BudgetPolicy, error)
    public static BudgetPolicy Get(string name, Input<string> id, BudgetPolicyState? state, CustomResourceOptions? opts = null)
    public static BudgetPolicy get(String name, Output<String> id, BudgetPolicyState state, CustomResourceOptions options)
    resources:  _:    type: databricks:BudgetPolicy    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:
    CustomTags List<BudgetPolicyCustomTag>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    PolicyId string
    ID of the budget policy
    PolicyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    CustomTags []BudgetPolicyCustomTagArgs
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    PolicyId string
    ID of the budget policy
    PolicyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags List<BudgetPolicyCustomTag>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyId String
    ID of the budget policy
    policyName String
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags BudgetPolicyCustomTag[]
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyId string
    ID of the budget policy
    policyName string
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    custom_tags Sequence[BudgetPolicyCustomTagArgs]
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policy_id str
    ID of the budget policy
    policy_name str
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
    customTags List<Property Map>
    A list of tags defined by the customer. At most 20 entries are allowed per policy.
    policyId String
    ID of the budget policy
    policyName String
    The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.

    Supporting Types

    BudgetPolicyCustomTag, BudgetPolicyCustomTagArgs

    Key string
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    Value string
    The value of the tag.
    Key string
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    Value string
    The value of the tag.
    key String
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    value String
    The value of the tag.
    key string
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    value string
    The value of the tag.
    key str
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    value str
    The value of the tag.
    key String
    The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
    value String
    The value of the tag.

    Import

    This resource can be imported by ID.

    $ pulumi import databricks:index/budgetPolicy:BudgetPolicy this 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
    Databricks v1.63.0 published on Thursday, Mar 13, 2025 by Pulumi