# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs

__all__ = [
    'GetTagPolicyResult',
    'AwaitableGetTagPolicyResult',
    'get_tag_policy',
    'get_tag_policy_output',
]

@pulumi.output_type
class GetTagPolicyResult:
    """
    A collection of values returned by getTagPolicy.
    """
    def __init__(__self__, create_time=None, description=None, id=None, tag_key=None, update_time=None, values=None):
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if tag_key and not isinstance(tag_key, str):
            raise TypeError("Expected argument 'tag_key' to be a str")
        pulumi.set(__self__, "tag_key", tag_key)
        if update_time and not isinstance(update_time, str):
            raise TypeError("Expected argument 'update_time' to be a str")
        pulumi.set(__self__, "update_time", update_time)
        if values and not isinstance(values, list):
            raise TypeError("Expected argument 'values' to be a list")
        pulumi.set(__self__, "values", values)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> _builtins.str:
        """
        (string) - Timestamp when the tag policy was created
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        (string)
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        (string)
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="tagKey")
    def tag_key(self) -> _builtins.str:
        """
        (string)
        """
        return pulumi.get(self, "tag_key")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> _builtins.str:
        """
        (string) - Timestamp when the tag policy was last updated
        """
        return pulumi.get(self, "update_time")

    @_builtins.property
    @pulumi.getter
    def values(self) -> Sequence['outputs.GetTagPolicyValueResult']:
        """
        (list of Value)
        """
        return pulumi.get(self, "values")


class AwaitableGetTagPolicyResult(GetTagPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetTagPolicyResult(
            create_time=self.create_time,
            description=self.description,
            id=self.id,
            tag_key=self.tag_key,
            update_time=self.update_time,
            values=self.values)


def get_tag_policy(tag_key: Optional[_builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTagPolicyResult:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to get a single tag policy by its tag key.

    The following resources are often used in the same context:

    * EntityTagAssignment for assigning tags to supported Unity Catalog entities.
    * WorkspaceEntityTagAssignment for assigning tags to supported workspace entities.
    * PolicyInfo for defining ABAC policies using governed tags.
    * AccessControlRuleSet for managing account-level and individual tag policy permissions.

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

    ## Example Usage

    Referring to a tag policy by its tag key:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    example_tag_policy = databricks.get_tag_policy(tag_key="example_tag_key")
    ```
    """
    __args__ = dict()
    __args__['tagKey'] = tag_key
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getTagPolicy:getTagPolicy', __args__, opts=opts, typ=GetTagPolicyResult).value

    return AwaitableGetTagPolicyResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        tag_key=pulumi.get(__ret__, 'tag_key'),
        update_time=pulumi.get(__ret__, 'update_time'),
        values=pulumi.get(__ret__, 'values'))
def get_tag_policy_output(tag_key: Optional[pulumi.Input[_builtins.str]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetTagPolicyResult]:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to get a single tag policy by its tag key.

    The following resources are often used in the same context:

    * EntityTagAssignment for assigning tags to supported Unity Catalog entities.
    * WorkspaceEntityTagAssignment for assigning tags to supported workspace entities.
    * PolicyInfo for defining ABAC policies using governed tags.
    * AccessControlRuleSet for managing account-level and individual tag policy permissions.

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

    ## Example Usage

    Referring to a tag policy by its tag key:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    example_tag_policy = databricks.get_tag_policy(tag_key="example_tag_key")
    ```
    """
    __args__ = dict()
    __args__['tagKey'] = tag_key
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getTagPolicy:getTagPolicy', __args__, opts=opts, typ=GetTagPolicyResult)
    return __ret__.apply(lambda __response__: GetTagPolicyResult(
        create_time=pulumi.get(__response__, 'create_time'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        tag_key=pulumi.get(__response__, 'tag_key'),
        update_time=pulumi.get(__response__, 'update_time'),
        values=pulumi.get(__response__, 'values')))
