# 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
from ._inputs import *

__all__ = ['PermissionAssignmentArgs', 'PermissionAssignment']

@pulumi.input_type
class PermissionAssignmentArgs:
    def __init__(__self__, *,
                 permissions: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]],
                 group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']] = None,
                 service_principal_name: Optional[pulumi.Input[_builtins.str]] = None,
                 user_name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a PermissionAssignment resource.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] permissions: The list of workspace permissions to assign to the principal:
               * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
               * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        :param pulumi.Input[_builtins.str] group_name: the group name to assign to a workspace.
        :param pulumi.Input[_builtins.str] principal_id: Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        :param pulumi.Input['PermissionAssignmentProviderConfigArgs'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.str] service_principal_name: the application ID of service principal to assign to a workspace.
        :param pulumi.Input[_builtins.str] user_name: the user name (email) to assign to a workspace.
        """
        pulumi.set(__self__, "permissions", permissions)
        if group_name is not None:
            pulumi.set(__self__, "group_name", group_name)
        if principal_id is not None:
            pulumi.set(__self__, "principal_id", principal_id)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if service_principal_name is not None:
            pulumi.set(__self__, "service_principal_name", service_principal_name)
        if user_name is not None:
            pulumi.set(__self__, "user_name", user_name)

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]:
        """
        The list of workspace permissions to assign to the principal:
        * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
        * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        """
        return pulumi.get(self, "permissions")

    @permissions.setter
    def permissions(self, value: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]):
        pulumi.set(self, "permissions", value)

    @_builtins.property
    @pulumi.getter(name="groupName")
    def group_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the group name to assign to a workspace.
        """
        return pulumi.get(self, "group_name")

    @group_name.setter
    def group_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "group_name", value)

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        """
        return pulumi.get(self, "principal_id")

    @principal_id.setter
    def principal_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "principal_id", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="servicePrincipalName")
    def service_principal_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the application ID of service principal to assign to a workspace.
        """
        return pulumi.get(self, "service_principal_name")

    @service_principal_name.setter
    def service_principal_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "service_principal_name", value)

    @_builtins.property
    @pulumi.getter(name="userName")
    def user_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the user name (email) to assign to a workspace.
        """
        return pulumi.get(self, "user_name")

    @user_name.setter
    def user_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "user_name", value)


@pulumi.input_type
class _PermissionAssignmentState:
    def __init__(__self__, *,
                 display_name: Optional[pulumi.Input[_builtins.str]] = None,
                 group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 permissions: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']] = None,
                 service_principal_name: Optional[pulumi.Input[_builtins.str]] = None,
                 user_name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering PermissionAssignment resources.
        :param pulumi.Input[_builtins.str] display_name: the display name of the assigned principal.
        :param pulumi.Input[_builtins.str] group_name: the group name to assign to a workspace.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] permissions: The list of workspace permissions to assign to the principal:
               * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
               * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        :param pulumi.Input[_builtins.str] principal_id: Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        :param pulumi.Input['PermissionAssignmentProviderConfigArgs'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.str] service_principal_name: the application ID of service principal to assign to a workspace.
        :param pulumi.Input[_builtins.str] user_name: the user name (email) to assign to a workspace.
        """
        if display_name is not None:
            pulumi.set(__self__, "display_name", display_name)
        if group_name is not None:
            pulumi.set(__self__, "group_name", group_name)
        if permissions is not None:
            pulumi.set(__self__, "permissions", permissions)
        if principal_id is not None:
            pulumi.set(__self__, "principal_id", principal_id)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if service_principal_name is not None:
            pulumi.set(__self__, "service_principal_name", service_principal_name)
        if user_name is not None:
            pulumi.set(__self__, "user_name", user_name)

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the display name of the assigned principal.
        """
        return pulumi.get(self, "display_name")

    @display_name.setter
    def display_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "display_name", value)

    @_builtins.property
    @pulumi.getter(name="groupName")
    def group_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the group name to assign to a workspace.
        """
        return pulumi.get(self, "group_name")

    @group_name.setter
    def group_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "group_name", value)

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
        """
        The list of workspace permissions to assign to the principal:
        * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
        * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        """
        return pulumi.get(self, "permissions")

    @permissions.setter
    def permissions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
        pulumi.set(self, "permissions", value)

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        """
        return pulumi.get(self, "principal_id")

    @principal_id.setter
    def principal_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "principal_id", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['PermissionAssignmentProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="servicePrincipalName")
    def service_principal_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the application ID of service principal to assign to a workspace.
        """
        return pulumi.get(self, "service_principal_name")

    @service_principal_name.setter
    def service_principal_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "service_principal_name", value)

    @_builtins.property
    @pulumi.getter(name="userName")
    def user_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the user name (email) to assign to a workspace.
        """
        return pulumi.get(self, "user_name")

    @user_name.setter
    def user_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "user_name", value)


@pulumi.type_token("databricks:index/permissionAssignment:PermissionAssignment")
class PermissionAssignment(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 permissions: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PermissionAssignmentProviderConfigArgs', 'PermissionAssignmentProviderConfigArgsDict']]] = None,
                 service_principal_name: Optional[pulumi.Input[_builtins.str]] = None,
                 user_name: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        This resource is used to assign account-level users, service principals and groups to a Databricks workspace. To configure additional entitlements such as cluster creation, please use Entitlements

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

        ## Example Usage

        ### Assign using `principal_id`

        In workspace context, adding account-level user to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        me = databricks.get_user(user_name="me@example.com")
        add_user = databricks.PermissionAssignment("add_user",
            principal_id=me.id,
            permissions=["USER"])
        ```

        In workspace context, adding account-level service principal to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        sp = databricks.get_service_principal(display_name="Automation-only SP")
        add_admin_spn = databricks.PermissionAssignment("add_admin_spn",
            principal_id=sp.id,
            permissions=["ADMIN"])
        ```

        In workspace context, adding account-level group to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        account_level = databricks.get_group(display_name="example-group")
        # Use the workspace provider
        this = databricks.PermissionAssignment("this",
            principal_id=account_level.id,
            permissions=["USER"])
        workspace_level = databricks.get_group(display_name="example-group")
        pulumi.export("databricksGroupId", workspace_level.id)
        ```

        ### Assign using `user_name`, `group_name`, or `service_principal_name`

        In workspace context, adding account-level user to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        add_user = databricks.PermissionAssignment("add_user",
            user_name="me@example.com",
            permissions=["USER"])
        ```

        In workspace context, adding account-level service principal to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        add_admin_spn = databricks.PermissionAssignment("add_admin_spn",
            service_principal_name="00000000-0000-0000-0000-000000000000",
            permissions=["ADMIN"])
        ```

        In workspace context, adding account-level group to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.PermissionAssignment("this",
            group_name="example-group",
            permissions=["USER"])
        ```

        ## Related Resources

        The following resources are used in the same context:

        * Group to manage [Account-level](https://docs.databricks.com/aws/en/admin/users-groups/groups) or [Workspace-level](https://docs.databricks.com/aws/en/admin/users-groups/workspace-local-groups) groups.
        * Group data to retrieve information about Group members, entitlements and instance profiles.
        * GroupMember to attach users and groups as group members.
        * MwsPermissionAssignment to manage permission assignment from an account context

        ## Import

        The resource `databricks_permission_assignment` can be imported using the principal id:

        hcl

        import {

          to = databricks_permission_assignment.this

          id = "<principal_id>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/permissionAssignment:PermissionAssignment this "<principal_id>"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] group_name: the group name to assign to a workspace.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] permissions: The list of workspace permissions to assign to the principal:
               * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
               * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        :param pulumi.Input[_builtins.str] principal_id: Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        :param pulumi.Input[Union['PermissionAssignmentProviderConfigArgs', 'PermissionAssignmentProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.str] service_principal_name: the application ID of service principal to assign to a workspace.
        :param pulumi.Input[_builtins.str] user_name: the user name (email) to assign to a workspace.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PermissionAssignmentArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        This resource is used to assign account-level users, service principals and groups to a Databricks workspace. To configure additional entitlements such as cluster creation, please use Entitlements

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

        ## Example Usage

        ### Assign using `principal_id`

        In workspace context, adding account-level user to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        me = databricks.get_user(user_name="me@example.com")
        add_user = databricks.PermissionAssignment("add_user",
            principal_id=me.id,
            permissions=["USER"])
        ```

        In workspace context, adding account-level service principal to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        sp = databricks.get_service_principal(display_name="Automation-only SP")
        add_admin_spn = databricks.PermissionAssignment("add_admin_spn",
            principal_id=sp.id,
            permissions=["ADMIN"])
        ```

        In workspace context, adding account-level group to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        # Use the account provider
        account_level = databricks.get_group(display_name="example-group")
        # Use the workspace provider
        this = databricks.PermissionAssignment("this",
            principal_id=account_level.id,
            permissions=["USER"])
        workspace_level = databricks.get_group(display_name="example-group")
        pulumi.export("databricksGroupId", workspace_level.id)
        ```

        ### Assign using `user_name`, `group_name`, or `service_principal_name`

        In workspace context, adding account-level user to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        add_user = databricks.PermissionAssignment("add_user",
            user_name="me@example.com",
            permissions=["USER"])
        ```

        In workspace context, adding account-level service principal to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        add_admin_spn = databricks.PermissionAssignment("add_admin_spn",
            service_principal_name="00000000-0000-0000-0000-000000000000",
            permissions=["ADMIN"])
        ```

        In workspace context, adding account-level group to a workspace:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.PermissionAssignment("this",
            group_name="example-group",
            permissions=["USER"])
        ```

        ## Related Resources

        The following resources are used in the same context:

        * Group to manage [Account-level](https://docs.databricks.com/aws/en/admin/users-groups/groups) or [Workspace-level](https://docs.databricks.com/aws/en/admin/users-groups/workspace-local-groups) groups.
        * Group data to retrieve information about Group members, entitlements and instance profiles.
        * GroupMember to attach users and groups as group members.
        * MwsPermissionAssignment to manage permission assignment from an account context

        ## Import

        The resource `databricks_permission_assignment` can be imported using the principal id:

        hcl

        import {

          to = databricks_permission_assignment.this

          id = "<principal_id>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/permissionAssignment:PermissionAssignment this "<principal_id>"
        ```

        :param str resource_name: The name of the resource.
        :param PermissionAssignmentArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(PermissionAssignmentArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 permissions: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PermissionAssignmentProviderConfigArgs', 'PermissionAssignmentProviderConfigArgsDict']]] = None,
                 service_principal_name: Optional[pulumi.Input[_builtins.str]] = None,
                 user_name: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = PermissionAssignmentArgs.__new__(PermissionAssignmentArgs)

            __props__.__dict__["group_name"] = group_name
            if permissions is None and not opts.urn:
                raise TypeError("Missing required property 'permissions'")
            __props__.__dict__["permissions"] = permissions
            __props__.__dict__["principal_id"] = principal_id
            __props__.__dict__["provider_config"] = provider_config
            __props__.__dict__["service_principal_name"] = service_principal_name
            __props__.__dict__["user_name"] = user_name
            __props__.__dict__["display_name"] = None
        super(PermissionAssignment, __self__).__init__(
            'databricks:index/permissionAssignment:PermissionAssignment',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            display_name: Optional[pulumi.Input[_builtins.str]] = None,
            group_name: Optional[pulumi.Input[_builtins.str]] = None,
            permissions: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
            principal_id: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['PermissionAssignmentProviderConfigArgs', 'PermissionAssignmentProviderConfigArgsDict']]] = None,
            service_principal_name: Optional[pulumi.Input[_builtins.str]] = None,
            user_name: Optional[pulumi.Input[_builtins.str]] = None) -> 'PermissionAssignment':
        """
        Get an existing PermissionAssignment resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] display_name: the display name of the assigned principal.
        :param pulumi.Input[_builtins.str] group_name: the group name to assign to a workspace.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] permissions: The list of workspace permissions to assign to the principal:
               * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
               * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        :param pulumi.Input[_builtins.str] principal_id: Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        :param pulumi.Input[Union['PermissionAssignmentProviderConfigArgs', 'PermissionAssignmentProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
        :param pulumi.Input[_builtins.str] service_principal_name: the application ID of service principal to assign to a workspace.
        :param pulumi.Input[_builtins.str] user_name: the user name (email) to assign to a workspace.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PermissionAssignmentState.__new__(_PermissionAssignmentState)

        __props__.__dict__["display_name"] = display_name
        __props__.__dict__["group_name"] = group_name
        __props__.__dict__["permissions"] = permissions
        __props__.__dict__["principal_id"] = principal_id
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["service_principal_name"] = service_principal_name
        __props__.__dict__["user_name"] = user_name
        return PermissionAssignment(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="displayName")
    def display_name(self) -> pulumi.Output[_builtins.str]:
        """
        the display name of the assigned principal.
        """
        return pulumi.get(self, "display_name")

    @_builtins.property
    @pulumi.getter(name="groupName")
    def group_name(self) -> pulumi.Output[_builtins.str]:
        """
        the group name to assign to a workspace.
        """
        return pulumi.get(self, "group_name")

    @_builtins.property
    @pulumi.getter
    def permissions(self) -> pulumi.Output[Sequence[_builtins.str]]:
        """
        The list of workspace permissions to assign to the principal:
        * `"USER"` - Adds principal to the workspace `users` group. This gives basic workspace access.
        * `"ADMIN"` - Adds principal to the workspace `admins` group. This gives workspace admin privileges to manage users and groups, workspace configurations, and more.
        """
        return pulumi.get(self, "permissions")

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> pulumi.Output[_builtins.str]:
        """
        Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the account-level SCIM API, or using databricks_user, ServicePrincipal or Group data sources with account API (and has to be an account admin). A more sensible approach is to retrieve the list of `principal_id` as outputs from another Pulumi stack.
        """
        return pulumi.get(self, "principal_id")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> pulumi.Output[Optional['outputs.PermissionAssignmentProviderConfig']]:
        """
        Configure the provider for management through account provider. This block consists of the following fields:
        """
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter(name="servicePrincipalName")
    def service_principal_name(self) -> pulumi.Output[_builtins.str]:
        """
        the application ID of service principal to assign to a workspace.
        """
        return pulumi.get(self, "service_principal_name")

    @_builtins.property
    @pulumi.getter(name="userName")
    def user_name(self) -> pulumi.Output[_builtins.str]:
        """
        the user name (email) to assign to a workspace.
        """
        return pulumi.get(self, "user_name")

