# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
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

__all__ = ['ClusterUserArgs', 'ClusterUser']

@pulumi.input_type
class ClusterUserArgs:
    def __init__(__self__, *,
                 cluster_id: pulumi.Input[builtins.str],
                 password: pulumi.Input[builtins.str],
                 user_name: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 old_password: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None):
        """
        The set of arguments for constructing a ClusterUser resource.
        :param pulumi.Input[builtins.str] cluster_id: 集群ID。
        :param pulumi.Input[builtins.str] password: 新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        :param pulumi.Input[builtins.str] user_name: 集群用户名。仅支持小写字母。
        :param pulumi.Input[builtins.str] description: 用户组描述。
        :param pulumi.Input[builtins.str] old_password: 旧的用户的登录密码。修改密码时必填。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] user_group_names: 所属用户组名称。
        """
        pulumi.set(__self__, "cluster_id", cluster_id)
        pulumi.set(__self__, "password", password)
        pulumi.set(__self__, "user_name", user_name)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if old_password is not None:
            pulumi.set(__self__, "old_password", old_password)
        if user_group_names is not None:
            pulumi.set(__self__, "user_group_names", user_group_names)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> pulumi.Input[builtins.str]:
        """
        集群ID。
        """
        return pulumi.get(self, "cluster_id")

    @cluster_id.setter
    def cluster_id(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "cluster_id", value)

    @property
    @pulumi.getter
    def password(self) -> pulumi.Input[builtins.str]:
        """
        新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        """
        return pulumi.get(self, "password")

    @password.setter
    def password(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "password", value)

    @property
    @pulumi.getter(name="userName")
    def user_name(self) -> pulumi.Input[builtins.str]:
        """
        集群用户名。仅支持小写字母。
        """
        return pulumi.get(self, "user_name")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组描述。
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="oldPassword")
    def old_password(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        旧的用户的登录密码。修改密码时必填。
        """
        return pulumi.get(self, "old_password")

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

    @property
    @pulumi.getter(name="userGroupNames")
    def user_group_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
        """
        所属用户组名称。
        """
        return pulumi.get(self, "user_group_names")

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


@pulumi.input_type
class _ClusterUserState:
    def __init__(__self__, *,
                 cluster_id: Optional[pulumi.Input[builtins.str]] = None,
                 created_time: Optional[pulumi.Input[builtins.int]] = None,
                 creator_name: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 old_password: Optional[pulumi.Input[builtins.str]] = None,
                 password: Optional[pulumi.Input[builtins.str]] = None,
                 updated_time: Optional[pulumi.Input[builtins.int]] = None,
                 user_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 user_name: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering ClusterUser resources.
        :param pulumi.Input[builtins.str] cluster_id: 集群ID。
        :param pulumi.Input[builtins.int] created_time: 创建时间。
        :param pulumi.Input[builtins.str] creator_name: 创建者用户名。
        :param pulumi.Input[builtins.str] description: 用户组描述。
        :param pulumi.Input[builtins.str] old_password: 旧的用户的登录密码。修改密码时必填。
        :param pulumi.Input[builtins.str] password: 新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        :param pulumi.Input[builtins.int] updated_time: 更新时间。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] user_group_names: 所属用户组名称。
        :param pulumi.Input[builtins.str] user_name: 集群用户名。仅支持小写字母。
        """
        if cluster_id is not None:
            pulumi.set(__self__, "cluster_id", cluster_id)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if creator_name is not None:
            pulumi.set(__self__, "creator_name", creator_name)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if old_password is not None:
            pulumi.set(__self__, "old_password", old_password)
        if password is not None:
            pulumi.set(__self__, "password", password)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)
        if user_group_names is not None:
            pulumi.set(__self__, "user_group_names", user_group_names)
        if user_name is not None:
            pulumi.set(__self__, "user_name", user_name)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        集群ID。
        """
        return pulumi.get(self, "cluster_id")

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

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "created_time", value)

    @property
    @pulumi.getter(name="creatorName")
    def creator_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        创建者用户名。
        """
        return pulumi.get(self, "creator_name")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组描述。
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="oldPassword")
    def old_password(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        旧的用户的登录密码。修改密码时必填。
        """
        return pulumi.get(self, "old_password")

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

    @property
    @pulumi.getter
    def password(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        """
        return pulumi.get(self, "password")

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

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @updated_time.setter
    def updated_time(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "updated_time", value)

    @property
    @pulumi.getter(name="userGroupNames")
    def user_group_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
        """
        所属用户组名称。
        """
        return pulumi.get(self, "user_group_names")

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

    @property
    @pulumi.getter(name="userName")
    def user_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        集群用户名。仅支持小写字母。
        """
        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("bytepluscc:emr/clusterUser:ClusterUser")
class ClusterUser(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cluster_id: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 old_password: Optional[pulumi.Input[builtins.str]] = None,
                 password: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 user_name: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        E-MapReduce（EMR）集群中的用户分为普通用户和系统用户两类。其中:普通用户是您在用户管理模块手动通过导入、创建操作向集群中添加的用户；系统用户则是集群在初始化过程中为每个组件内置的管理用户，不支持编辑和删除操作。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        e_mr_cluster_user_demo = bytepluscc.emr.ClusterUser("EMRClusterUserDemo",
            cluster_id="emr-xxxxxxxxxx",
            user_name="emrclusteruserdemo",
            password="UserDemo1234",
            user_group_names=[
                "users",
                "ccapi",
            ],
            description="EMRClusterUserDemo")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:emr/clusterUser:ClusterUser example "cluster_id|user_name"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] cluster_id: 集群ID。
        :param pulumi.Input[builtins.str] description: 用户组描述。
        :param pulumi.Input[builtins.str] old_password: 旧的用户的登录密码。修改密码时必填。
        :param pulumi.Input[builtins.str] password: 新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] user_group_names: 所属用户组名称。
        :param pulumi.Input[builtins.str] user_name: 集群用户名。仅支持小写字母。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ClusterUserArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        E-MapReduce（EMR）集群中的用户分为普通用户和系统用户两类。其中:普通用户是您在用户管理模块手动通过导入、创建操作向集群中添加的用户；系统用户则是集群在初始化过程中为每个组件内置的管理用户，不支持编辑和删除操作。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        e_mr_cluster_user_demo = bytepluscc.emr.ClusterUser("EMRClusterUserDemo",
            cluster_id="emr-xxxxxxxxxx",
            user_name="emrclusteruserdemo",
            password="UserDemo1234",
            user_group_names=[
                "users",
                "ccapi",
            ],
            description="EMRClusterUserDemo")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:emr/clusterUser:ClusterUser example "cluster_id|user_name"
        ```

        :param str resource_name: The name of the resource.
        :param ClusterUserArgs 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(ClusterUserArgs, 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,
                 cluster_id: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 old_password: Optional[pulumi.Input[builtins.str]] = None,
                 password: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_names: Optional[pulumi.Input[Sequence[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__ = ClusterUserArgs.__new__(ClusterUserArgs)

            if cluster_id is None and not opts.urn:
                raise TypeError("Missing required property 'cluster_id'")
            __props__.__dict__["cluster_id"] = cluster_id
            __props__.__dict__["description"] = description
            __props__.__dict__["old_password"] = old_password
            if password is None and not opts.urn:
                raise TypeError("Missing required property 'password'")
            __props__.__dict__["password"] = password
            __props__.__dict__["user_group_names"] = user_group_names
            if user_name is None and not opts.urn:
                raise TypeError("Missing required property 'user_name'")
            __props__.__dict__["user_name"] = user_name
            __props__.__dict__["created_time"] = None
            __props__.__dict__["creator_name"] = None
            __props__.__dict__["updated_time"] = None
        super(ClusterUser, __self__).__init__(
            'bytepluscc:emr/clusterUser:ClusterUser',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            cluster_id: Optional[pulumi.Input[builtins.str]] = None,
            created_time: Optional[pulumi.Input[builtins.int]] = None,
            creator_name: Optional[pulumi.Input[builtins.str]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            old_password: Optional[pulumi.Input[builtins.str]] = None,
            password: Optional[pulumi.Input[builtins.str]] = None,
            updated_time: Optional[pulumi.Input[builtins.int]] = None,
            user_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
            user_name: Optional[pulumi.Input[builtins.str]] = None) -> 'ClusterUser':
        """
        Get an existing ClusterUser 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] cluster_id: 集群ID。
        :param pulumi.Input[builtins.int] created_time: 创建时间。
        :param pulumi.Input[builtins.str] creator_name: 创建者用户名。
        :param pulumi.Input[builtins.str] description: 用户组描述。
        :param pulumi.Input[builtins.str] old_password: 旧的用户的登录密码。修改密码时必填。
        :param pulumi.Input[builtins.str] password: 新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        :param pulumi.Input[builtins.int] updated_time: 更新时间。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] user_group_names: 所属用户组名称。
        :param pulumi.Input[builtins.str] user_name: 集群用户名。仅支持小写字母。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ClusterUserState.__new__(_ClusterUserState)

        __props__.__dict__["cluster_id"] = cluster_id
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["creator_name"] = creator_name
        __props__.__dict__["description"] = description
        __props__.__dict__["old_password"] = old_password
        __props__.__dict__["password"] = password
        __props__.__dict__["updated_time"] = updated_time
        __props__.__dict__["user_group_names"] = user_group_names
        __props__.__dict__["user_name"] = user_name
        return ClusterUser(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> pulumi.Output[builtins.str]:
        """
        集群ID。
        """
        return pulumi.get(self, "cluster_id")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.int]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="creatorName")
    def creator_name(self) -> pulumi.Output[builtins.str]:
        """
        创建者用户名。
        """
        return pulumi.get(self, "creator_name")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        用户组描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="oldPassword")
    def old_password(self) -> pulumi.Output[builtins.str]:
        """
        旧的用户的登录密码。修改密码时必填。
        """
        return pulumi.get(self, "old_password")

    @property
    @pulumi.getter
    def password(self) -> pulumi.Output[builtins.str]:
        """
        新的用户的登录密码。密码的长度需在8-20个字符之间，支持数字，字母，-，_ 且 至少包含1个数字和1个字母。
        """
        return pulumi.get(self, "password")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.int]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="userGroupNames")
    def user_group_names(self) -> pulumi.Output[Sequence[builtins.str]]:
        """
        所属用户组名称。
        """
        return pulumi.get(self, "user_group_names")

    @property
    @pulumi.getter(name="userName")
    def user_name(self) -> pulumi.Output[builtins.str]:
        """
        集群用户名。仅支持小写字母。
        """
        return pulumi.get(self, "user_name")

