1. Packages
  2. Databricks Provider
  3. API Docs
  4. TagPolicy
Databricks v1.78.0 published on Friday, Nov 7, 2025 by Pulumi

databricks.TagPolicy

Start a Neo task
Explain and create a databricks.TagPolicy resource
databricks logo
Databricks v1.78.0 published on Friday, Nov 7, 2025 by Pulumi

    Public Preview

    Define tag policies to manage governed tags in your account.

    Note This resource can only be used with a workspace-level provider!

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const exampleTagPolicy = new databricks.TagPolicy("example_tag_policy", {
        tagKey: "example_tag_key",
        description: "Example description.",
        values: [
            {
                name: "example_value_1",
            },
            {
                name: "example_value_2",
            },
            {
                name: "example_value_3",
            },
        ],
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    example_tag_policy = databricks.TagPolicy("example_tag_policy",
        tag_key="example_tag_key",
        description="Example description.",
        values=[
            {
                "name": "example_value_1",
            },
            {
                "name": "example_value_2",
            },
            {
                "name": "example_value_3",
            },
        ])
    
    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.NewTagPolicy(ctx, "example_tag_policy", &databricks.TagPolicyArgs{
    			TagKey:      pulumi.String("example_tag_key"),
    			Description: pulumi.String("Example description."),
    			Values: databricks.TagPolicyValueArray{
    				&databricks.TagPolicyValueArgs{
    					Name: pulumi.String("example_value_1"),
    				},
    				&databricks.TagPolicyValueArgs{
    					Name: pulumi.String("example_value_2"),
    				},
    				&databricks.TagPolicyValueArgs{
    					Name: pulumi.String("example_value_3"),
    				},
    			},
    		})
    		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 exampleTagPolicy = new Databricks.TagPolicy("example_tag_policy", new()
        {
            TagKey = "example_tag_key",
            Description = "Example description.",
            Values = new[]
            {
                new Databricks.Inputs.TagPolicyValueArgs
                {
                    Name = "example_value_1",
                },
                new Databricks.Inputs.TagPolicyValueArgs
                {
                    Name = "example_value_2",
                },
                new Databricks.Inputs.TagPolicyValueArgs
                {
                    Name = "example_value_3",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.TagPolicy;
    import com.pulumi.databricks.TagPolicyArgs;
    import com.pulumi.databricks.inputs.TagPolicyValueArgs;
    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 exampleTagPolicy = new TagPolicy("exampleTagPolicy", TagPolicyArgs.builder()
                .tagKey("example_tag_key")
                .description("Example description.")
                .values(            
                    TagPolicyValueArgs.builder()
                        .name("example_value_1")
                        .build(),
                    TagPolicyValueArgs.builder()
                        .name("example_value_2")
                        .build(),
                    TagPolicyValueArgs.builder()
                        .name("example_value_3")
                        .build())
                .build());
    
        }
    }
    
    resources:
      exampleTagPolicy:
        type: databricks:TagPolicy
        name: example_tag_policy
        properties:
          tagKey: example_tag_key
          description: Example description.
          values:
            - name: example_value_1
            - name: example_value_2
            - name: example_value_3
    

    Create TagPolicy Resource

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

    Constructor syntax

    new TagPolicy(name: string, args: TagPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def TagPolicy(resource_name: str,
                  args: TagPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def TagPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  tag_key: Optional[str] = None,
                  description: Optional[str] = None,
                  values: Optional[Sequence[TagPolicyValueArgs]] = None)
    func NewTagPolicy(ctx *Context, name string, args TagPolicyArgs, opts ...ResourceOption) (*TagPolicy, error)
    public TagPolicy(string name, TagPolicyArgs args, CustomResourceOptions? opts = null)
    public TagPolicy(String name, TagPolicyArgs args)
    public TagPolicy(String name, TagPolicyArgs args, CustomResourceOptions options)
    
    type: databricks:TagPolicy
    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 TagPolicyArgs
    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 TagPolicyArgs
    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 TagPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TagPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TagPolicyArgs
    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 tagPolicyResource = new Databricks.TagPolicy("tagPolicyResource", new()
    {
        TagKey = "string",
        Description = "string",
        Values = new[]
        {
            new Databricks.Inputs.TagPolicyValueArgs
            {
                Name = "string",
            },
        },
    });
    
    example, err := databricks.NewTagPolicy(ctx, "tagPolicyResource", &databricks.TagPolicyArgs{
    	TagKey:      pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Values: databricks.TagPolicyValueArray{
    		&databricks.TagPolicyValueArgs{
    			Name: pulumi.String("string"),
    		},
    	},
    })
    
    var tagPolicyResource = new TagPolicy("tagPolicyResource", TagPolicyArgs.builder()
        .tagKey("string")
        .description("string")
        .values(TagPolicyValueArgs.builder()
            .name("string")
            .build())
        .build());
    
    tag_policy_resource = databricks.TagPolicy("tagPolicyResource",
        tag_key="string",
        description="string",
        values=[{
            "name": "string",
        }])
    
    const tagPolicyResource = new databricks.TagPolicy("tagPolicyResource", {
        tagKey: "string",
        description: "string",
        values: [{
            name: "string",
        }],
    });
    
    type: databricks:TagPolicy
    properties:
        description: string
        tagKey: string
        values:
            - name: string
    

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

    Outputs

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

    CreateTime string
    (string) - Timestamp when the tag policy was created
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    (string) - Timestamp when the tag policy was last updated
    CreateTime string
    (string) - Timestamp when the tag policy was created
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    (string) - Timestamp when the tag policy was last updated
    createTime String
    (string) - Timestamp when the tag policy was created
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    (string) - Timestamp when the tag policy was last updated
    createTime string
    (string) - Timestamp when the tag policy was created
    id string
    The provider-assigned unique ID for this managed resource.
    updateTime string
    (string) - Timestamp when the tag policy was last updated
    create_time str
    (string) - Timestamp when the tag policy was created
    id str
    The provider-assigned unique ID for this managed resource.
    update_time str
    (string) - Timestamp when the tag policy was last updated
    createTime String
    (string) - Timestamp when the tag policy was created
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    (string) - Timestamp when the tag policy was last updated

    Look up Existing TagPolicy Resource

    Get an existing TagPolicy 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?: TagPolicyState, opts?: CustomResourceOptions): TagPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            tag_key: Optional[str] = None,
            update_time: Optional[str] = None,
            values: Optional[Sequence[TagPolicyValueArgs]] = None) -> TagPolicy
    func GetTagPolicy(ctx *Context, name string, id IDInput, state *TagPolicyState, opts ...ResourceOption) (*TagPolicy, error)
    public static TagPolicy Get(string name, Input<string> id, TagPolicyState? state, CustomResourceOptions? opts = null)
    public static TagPolicy get(String name, Output<String> id, TagPolicyState state, CustomResourceOptions options)
    resources:  _:    type: databricks:TagPolicy    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:
    CreateTime string
    (string) - Timestamp when the tag policy was created
    Description string
    TagKey string
    UpdateTime string
    (string) - Timestamp when the tag policy was last updated
    Values List<TagPolicyValue>
    CreateTime string
    (string) - Timestamp when the tag policy was created
    Description string
    TagKey string
    UpdateTime string
    (string) - Timestamp when the tag policy was last updated
    Values []TagPolicyValueArgs
    createTime String
    (string) - Timestamp when the tag policy was created
    description String
    tagKey String
    updateTime String
    (string) - Timestamp when the tag policy was last updated
    values List<TagPolicyValue>
    createTime string
    (string) - Timestamp when the tag policy was created
    description string
    tagKey string
    updateTime string
    (string) - Timestamp when the tag policy was last updated
    values TagPolicyValue[]
    create_time str
    (string) - Timestamp when the tag policy was created
    description str
    tag_key str
    update_time str
    (string) - Timestamp when the tag policy was last updated
    values Sequence[TagPolicyValueArgs]
    createTime String
    (string) - Timestamp when the tag policy was created
    description String
    tagKey String
    updateTime String
    (string) - Timestamp when the tag policy was last updated
    values List<Property Map>

    Supporting Types

    TagPolicyValue, TagPolicyValueArgs

    Name string
    Name string
    name String
    name string
    name str
    name String

    Import

    As of Pulumi v1.5, resources can be imported through configuration.

    hcl

    import {

    id = “tag_key”

    to = databricks_tag_policy.this

    }

    If you are using an older version of Pulumi, import the resource using the pulumi import command as follows:

    $ pulumi import databricks:index/tagPolicy:TagPolicy this "tag_key"
    

    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.78.0 published on Friday, Nov 7, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate