databricks.EntityTagAssignment
This resource allows you to create, update, list, and delete tag assignments on Unity Catalog entities.
Example Usage
Basic tag assignment to a catalog
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const catalogTag = new databricks.EntityTagAssignment("catalog_tag", {
entityType: "catalogs",
entityName: "production_catalog",
tagKey: "environment",
tagValue: "production",
});
const schemaTag = new databricks.EntityTagAssignment("schema_tag", {
entityType: "schemas",
entityName: "production_catalog.sales_data",
tagKey: "owner",
tagValue: "sales-team",
});
const tableTag = new databricks.EntityTagAssignment("table_tag", {
entityType: "tables",
entityName: "production_catalog.sales_data.customer_orders",
tagKey: "data_classification",
tagValue: "confidential",
});
const columnTag = new databricks.EntityTagAssignment("column_tag", {
entityType: "columns",
entityName: "production_catalog.sales_data.customers.email_address",
tagKey: "pii",
tagValue: "email",
});
const volumeTag = new databricks.EntityTagAssignment("volume_tag", {
entityType: "volumes",
entityName: "production_catalog.raw_data.landing_zone",
tagKey: "purpose",
tagValue: "data_ingestion",
});
import pulumi
import pulumi_databricks as databricks
catalog_tag = databricks.EntityTagAssignment("catalog_tag",
entity_type="catalogs",
entity_name="production_catalog",
tag_key="environment",
tag_value="production")
schema_tag = databricks.EntityTagAssignment("schema_tag",
entity_type="schemas",
entity_name="production_catalog.sales_data",
tag_key="owner",
tag_value="sales-team")
table_tag = databricks.EntityTagAssignment("table_tag",
entity_type="tables",
entity_name="production_catalog.sales_data.customer_orders",
tag_key="data_classification",
tag_value="confidential")
column_tag = databricks.EntityTagAssignment("column_tag",
entity_type="columns",
entity_name="production_catalog.sales_data.customers.email_address",
tag_key="pii",
tag_value="email")
volume_tag = databricks.EntityTagAssignment("volume_tag",
entity_type="volumes",
entity_name="production_catalog.raw_data.landing_zone",
tag_key="purpose",
tag_value="data_ingestion")
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.NewEntityTagAssignment(ctx, "catalog_tag", &databricks.EntityTagAssignmentArgs{
EntityType: pulumi.String("catalogs"),
EntityName: pulumi.String("production_catalog"),
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("production"),
})
if err != nil {
return err
}
_, err = databricks.NewEntityTagAssignment(ctx, "schema_tag", &databricks.EntityTagAssignmentArgs{
EntityType: pulumi.String("schemas"),
EntityName: pulumi.String("production_catalog.sales_data"),
TagKey: pulumi.String("owner"),
TagValue: pulumi.String("sales-team"),
})
if err != nil {
return err
}
_, err = databricks.NewEntityTagAssignment(ctx, "table_tag", &databricks.EntityTagAssignmentArgs{
EntityType: pulumi.String("tables"),
EntityName: pulumi.String("production_catalog.sales_data.customer_orders"),
TagKey: pulumi.String("data_classification"),
TagValue: pulumi.String("confidential"),
})
if err != nil {
return err
}
_, err = databricks.NewEntityTagAssignment(ctx, "column_tag", &databricks.EntityTagAssignmentArgs{
EntityType: pulumi.String("columns"),
EntityName: pulumi.String("production_catalog.sales_data.customers.email_address"),
TagKey: pulumi.String("pii"),
TagValue: pulumi.String("email"),
})
if err != nil {
return err
}
_, err = databricks.NewEntityTagAssignment(ctx, "volume_tag", &databricks.EntityTagAssignmentArgs{
EntityType: pulumi.String("volumes"),
EntityName: pulumi.String("production_catalog.raw_data.landing_zone"),
TagKey: pulumi.String("purpose"),
TagValue: pulumi.String("data_ingestion"),
})
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 catalogTag = new Databricks.EntityTagAssignment("catalog_tag", new()
{
EntityType = "catalogs",
EntityName = "production_catalog",
TagKey = "environment",
TagValue = "production",
});
var schemaTag = new Databricks.EntityTagAssignment("schema_tag", new()
{
EntityType = "schemas",
EntityName = "production_catalog.sales_data",
TagKey = "owner",
TagValue = "sales-team",
});
var tableTag = new Databricks.EntityTagAssignment("table_tag", new()
{
EntityType = "tables",
EntityName = "production_catalog.sales_data.customer_orders",
TagKey = "data_classification",
TagValue = "confidential",
});
var columnTag = new Databricks.EntityTagAssignment("column_tag", new()
{
EntityType = "columns",
EntityName = "production_catalog.sales_data.customers.email_address",
TagKey = "pii",
TagValue = "email",
});
var volumeTag = new Databricks.EntityTagAssignment("volume_tag", new()
{
EntityType = "volumes",
EntityName = "production_catalog.raw_data.landing_zone",
TagKey = "purpose",
TagValue = "data_ingestion",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.EntityTagAssignment;
import com.pulumi.databricks.EntityTagAssignmentArgs;
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 catalogTag = new EntityTagAssignment("catalogTag", EntityTagAssignmentArgs.builder()
.entityType("catalogs")
.entityName("production_catalog")
.tagKey("environment")
.tagValue("production")
.build());
var schemaTag = new EntityTagAssignment("schemaTag", EntityTagAssignmentArgs.builder()
.entityType("schemas")
.entityName("production_catalog.sales_data")
.tagKey("owner")
.tagValue("sales-team")
.build());
var tableTag = new EntityTagAssignment("tableTag", EntityTagAssignmentArgs.builder()
.entityType("tables")
.entityName("production_catalog.sales_data.customer_orders")
.tagKey("data_classification")
.tagValue("confidential")
.build());
var columnTag = new EntityTagAssignment("columnTag", EntityTagAssignmentArgs.builder()
.entityType("columns")
.entityName("production_catalog.sales_data.customers.email_address")
.tagKey("pii")
.tagValue("email")
.build());
var volumeTag = new EntityTagAssignment("volumeTag", EntityTagAssignmentArgs.builder()
.entityType("volumes")
.entityName("production_catalog.raw_data.landing_zone")
.tagKey("purpose")
.tagValue("data_ingestion")
.build());
}
}
resources:
catalogTag:
type: databricks:EntityTagAssignment
name: catalog_tag
properties:
entityType: catalogs
entityName: production_catalog
tagKey: environment
tagValue: production
schemaTag:
type: databricks:EntityTagAssignment
name: schema_tag
properties:
entityType: schemas
entityName: production_catalog.sales_data
tagKey: owner
tagValue: sales-team
tableTag:
type: databricks:EntityTagAssignment
name: table_tag
properties:
entityType: tables
entityName: production_catalog.sales_data.customer_orders
tagKey: data_classification
tagValue: confidential
columnTag:
type: databricks:EntityTagAssignment
name: column_tag
properties:
entityType: columns
entityName: production_catalog.sales_data.customers.email_address
tagKey: pii
tagValue: email
volumeTag:
type: databricks:EntityTagAssignment
name: volume_tag
properties:
entityType: volumes
entityName: production_catalog.raw_data.landing_zone
tagKey: purpose
tagValue: data_ingestion
Create EntityTagAssignment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EntityTagAssignment(name: string, args: EntityTagAssignmentArgs, opts?: CustomResourceOptions);@overload
def EntityTagAssignment(resource_name: str,
args: EntityTagAssignmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EntityTagAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
entity_name: Optional[str] = None,
entity_type: Optional[str] = None,
tag_key: Optional[str] = None,
tag_value: Optional[str] = None)func NewEntityTagAssignment(ctx *Context, name string, args EntityTagAssignmentArgs, opts ...ResourceOption) (*EntityTagAssignment, error)public EntityTagAssignment(string name, EntityTagAssignmentArgs args, CustomResourceOptions? opts = null)
public EntityTagAssignment(String name, EntityTagAssignmentArgs args)
public EntityTagAssignment(String name, EntityTagAssignmentArgs args, CustomResourceOptions options)
type: databricks:EntityTagAssignment
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 EntityTagAssignmentArgs
- 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 EntityTagAssignmentArgs
- 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 EntityTagAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EntityTagAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EntityTagAssignmentArgs
- 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 entityTagAssignmentResource = new Databricks.EntityTagAssignment("entityTagAssignmentResource", new()
{
EntityName = "string",
EntityType = "string",
TagKey = "string",
TagValue = "string",
});
example, err := databricks.NewEntityTagAssignment(ctx, "entityTagAssignmentResource", &databricks.EntityTagAssignmentArgs{
EntityName: pulumi.String("string"),
EntityType: pulumi.String("string"),
TagKey: pulumi.String("string"),
TagValue: pulumi.String("string"),
})
var entityTagAssignmentResource = new EntityTagAssignment("entityTagAssignmentResource", EntityTagAssignmentArgs.builder()
.entityName("string")
.entityType("string")
.tagKey("string")
.tagValue("string")
.build());
entity_tag_assignment_resource = databricks.EntityTagAssignment("entityTagAssignmentResource",
entity_name="string",
entity_type="string",
tag_key="string",
tag_value="string")
const entityTagAssignmentResource = new databricks.EntityTagAssignment("entityTagAssignmentResource", {
entityName: "string",
entityType: "string",
tagKey: "string",
tagValue: "string",
});
type: databricks:EntityTagAssignment
properties:
entityName: string
entityType: string
tagKey: string
tagValue: string
EntityTagAssignment 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 EntityTagAssignment resource accepts the following input properties:
- Entity
Name string - The fully qualified name of the entity to which the tag is assigned
- Entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- Tag
Key string - The key of the tag
- Tag
Value string - The value of the tag
- Entity
Name string - The fully qualified name of the entity to which the tag is assigned
- Entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- Tag
Key string - The key of the tag
- Tag
Value string - The value of the tag
- entity
Name String - The fully qualified name of the entity to which the tag is assigned
- entity
Type String - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key String - The key of the tag
- tag
Value String - The value of the tag
- entity
Name string - The fully qualified name of the entity to which the tag is assigned
- entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key string - The key of the tag
- tag
Value string - The value of the tag
- entity_
name str - The fully qualified name of the entity to which the tag is assigned
- entity_
type str - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag_
key str - The key of the tag
- tag_
value str - The value of the tag
- entity
Name String - The fully qualified name of the entity to which the tag is assigned
- entity
Type String - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key String - The key of the tag
- tag
Value String - The value of the tag
Outputs
All input properties are implicitly available as output properties. Additionally, the EntityTagAssignment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing EntityTagAssignment Resource
Get an existing EntityTagAssignment 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?: EntityTagAssignmentState, opts?: CustomResourceOptions): EntityTagAssignment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
entity_name: Optional[str] = None,
entity_type: Optional[str] = None,
tag_key: Optional[str] = None,
tag_value: Optional[str] = None) -> EntityTagAssignmentfunc GetEntityTagAssignment(ctx *Context, name string, id IDInput, state *EntityTagAssignmentState, opts ...ResourceOption) (*EntityTagAssignment, error)public static EntityTagAssignment Get(string name, Input<string> id, EntityTagAssignmentState? state, CustomResourceOptions? opts = null)public static EntityTagAssignment get(String name, Output<String> id, EntityTagAssignmentState state, CustomResourceOptions options)resources: _: type: databricks:EntityTagAssignment 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.
- Entity
Name string - The fully qualified name of the entity to which the tag is assigned
- Entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- Tag
Key string - The key of the tag
- Tag
Value string - The value of the tag
- Entity
Name string - The fully qualified name of the entity to which the tag is assigned
- Entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- Tag
Key string - The key of the tag
- Tag
Value string - The value of the tag
- entity
Name String - The fully qualified name of the entity to which the tag is assigned
- entity
Type String - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key String - The key of the tag
- tag
Value String - The value of the tag
- entity
Name string - The fully qualified name of the entity to which the tag is assigned
- entity
Type string - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key string - The key of the tag
- tag
Value string - The value of the tag
- entity_
name str - The fully qualified name of the entity to which the tag is assigned
- entity_
type str - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag_
key str - The key of the tag
- tag_
value str - The value of the tag
- entity
Name String - The fully qualified name of the entity to which the tag is assigned
- entity
Type String - The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes
- tag
Key String - The key of the tag
- tag
Value String - The value of the tag
Import
As of Pulumi v1.5, resources can be imported through configuration.
hcl
import {
id = “entity_type,entity_name,tag_key”
to = databricks_entity_tag_assignment.this
}
If you are using an older version of Pulumi, import the resource using the pulumi import command as follows:
$ pulumi import databricks:index/entityTagAssignment:EntityTagAssignment this "entity_type,entity_name,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
databricksTerraform Provider.
