databricks.TagPolicy
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:
- Tag
Key string - Description string
- Values
List<Tag
Policy Value>
- Tag
Key string - Description string
- Values
[]Tag
Policy Value Args
- tag
Key String - description String
- values
List<Tag
Policy Value>
- tag
Key string - description string
- values
Tag
Policy Value[]
- tag
Key String - description String
- values List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the TagPolicy resource produces the following output properties:
- Create
Time string - (string) - Timestamp when the tag policy was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - (string) - Timestamp when the tag policy was last updated
- Create
Time string - (string) - Timestamp when the tag policy was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - (string) - Timestamp when the tag policy was last updated
- create
Time String - (string) - Timestamp when the tag policy was created
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time String - (string) - Timestamp when the tag policy was last updated
- create
Time string - (string) - Timestamp when the tag policy was created
- id string
- The provider-assigned unique ID for this managed resource.
- update
Time 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
- create
Time String - (string) - Timestamp when the tag policy was created
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time 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) -> TagPolicyfunc 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.
- Create
Time string - (string) - Timestamp when the tag policy was created
- Description string
- Tag
Key string - Update
Time string - (string) - Timestamp when the tag policy was last updated
- Values
List<Tag
Policy Value>
- Create
Time string - (string) - Timestamp when the tag policy was created
- Description string
- Tag
Key string - Update
Time string - (string) - Timestamp when the tag policy was last updated
- Values
[]Tag
Policy Value Args
- create
Time String - (string) - Timestamp when the tag policy was created
- description String
- tag
Key String - update
Time String - (string) - Timestamp when the tag policy was last updated
- values
List<Tag
Policy Value>
- create
Time string - (string) - Timestamp when the tag policy was created
- description string
- tag
Key string - update
Time string - (string) - Timestamp when the tag policy was last updated
- values
Tag
Policy Value[]
- 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[Tag
Policy Value Args]
- create
Time String - (string) - Timestamp when the tag policy was created
- description String
- tag
Key String - update
Time 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
databricksTerraform Provider.
