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

__all__ = [
    'GetRoleResult',
    'AwaitableGetRoleResult',
    'get_role',
    'get_role_output',
]

@pulumi.output_type
class GetRoleResult:
    """
    A collection of values returned by getRole.
    """
    def __init__(__self__, create_date=None, description=None, display_name=None, id=None, is_service_linked_role=None, max_session_duration=None, policies=None, role_id=None, role_name=None, tags=None, trn=None, trust_policy_document=None, update_date=None):
        if create_date and not isinstance(create_date, str):
            raise TypeError("Expected argument 'create_date' to be a str")
        pulumi.set(__self__, "create_date", create_date)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if display_name and not isinstance(display_name, str):
            raise TypeError("Expected argument 'display_name' to be a str")
        pulumi.set(__self__, "display_name", display_name)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_service_linked_role and not isinstance(is_service_linked_role, int):
            raise TypeError("Expected argument 'is_service_linked_role' to be a int")
        pulumi.set(__self__, "is_service_linked_role", is_service_linked_role)
        if max_session_duration and not isinstance(max_session_duration, int):
            raise TypeError("Expected argument 'max_session_duration' to be a int")
        pulumi.set(__self__, "max_session_duration", max_session_duration)
        if policies and not isinstance(policies, list):
            raise TypeError("Expected argument 'policies' to be a list")
        pulumi.set(__self__, "policies", policies)
        if role_id and not isinstance(role_id, int):
            raise TypeError("Expected argument 'role_id' to be a int")
        pulumi.set(__self__, "role_id", role_id)
        if role_name and not isinstance(role_name, str):
            raise TypeError("Expected argument 'role_name' to be a str")
        pulumi.set(__self__, "role_name", role_name)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if trn and not isinstance(trn, str):
            raise TypeError("Expected argument 'trn' to be a str")
        pulumi.set(__self__, "trn", trn)
        if trust_policy_document and not isinstance(trust_policy_document, str):
            raise TypeError("Expected argument 'trust_policy_document' to be a str")
        pulumi.set(__self__, "trust_policy_document", trust_policy_document)
        if update_date and not isinstance(update_date, str):
            raise TypeError("Expected argument 'update_date' to be a str")
        pulumi.set(__self__, "update_date", update_date)

    @property
    @pulumi.getter(name="createDate")
    def create_date(self) -> builtins.str:
        """
        角色创建时间。
        """
        return pulumi.get(self, "create_date")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        角色描述，长度不超过128。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="displayName")
    def display_name(self) -> builtins.str:
        """
        角色显示名，长度不超过64。
        """
        return pulumi.get(self, "display_name")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isServiceLinkedRole")
    def is_service_linked_role(self) -> builtins.int:
        """
        是否是服务关联角色, 0否，1是。
        """
        return pulumi.get(self, "is_service_linked_role")

    @property
    @pulumi.getter(name="maxSessionDuration")
    def max_session_duration(self) -> builtins.int:
        """
        角色最大会话时间，角色最大会话时间。用于限制角色扮演产生的临时安全凭证的有效期的最大范围。取值范围：3600~43200，单位为秒，默认为43200。
        """
        return pulumi.get(self, "max_session_duration")

    @property
    @pulumi.getter
    def policies(self) -> Sequence['outputs.GetRolePolicyResult']:
        return pulumi.get(self, "policies")

    @property
    @pulumi.getter(name="roleId")
    def role_id(self) -> builtins.int:
        """
        角色ID。
        """
        return pulumi.get(self, "role_id")

    @property
    @pulumi.getter(name="roleName")
    def role_name(self) -> builtins.str:
        """
        角色名，长度1~64，支持英文、数字和.-_符号。
        """
        return pulumi.get(self, "role_name")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetRoleTagResult']:
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def trn(self) -> builtins.str:
        """
        角色TRN。
        """
        return pulumi.get(self, "trn")

    @property
    @pulumi.getter(name="trustPolicyDocument")
    def trust_policy_document(self) -> builtins.str:
        """
        角色信任策略，信任策略遵循IAM的策略语法中基于资源的策略规则。
        """
        return pulumi.get(self, "trust_policy_document")

    @property
    @pulumi.getter(name="updateDate")
    def update_date(self) -> builtins.str:
        """
        角色更新时间。
        """
        return pulumi.get(self, "update_date")


class AwaitableGetRoleResult(GetRoleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRoleResult(
            create_date=self.create_date,
            description=self.description,
            display_name=self.display_name,
            id=self.id,
            is_service_linked_role=self.is_service_linked_role,
            max_session_duration=self.max_session_duration,
            policies=self.policies,
            role_id=self.role_id,
            role_name=self.role_name,
            tags=self.tags,
            trn=self.trn,
            trust_policy_document=self.trust_policy_document,
            update_date=self.update_date)


def get_role(id: Optional[builtins.str] = None,
             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRoleResult:
    """
    Data Source schema for Byteplus::IAM::Role


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:iam/getRole:getRole', __args__, opts=opts, typ=GetRoleResult).value

    return AwaitableGetRoleResult(
        create_date=pulumi.get(__ret__, 'create_date'),
        description=pulumi.get(__ret__, 'description'),
        display_name=pulumi.get(__ret__, 'display_name'),
        id=pulumi.get(__ret__, 'id'),
        is_service_linked_role=pulumi.get(__ret__, 'is_service_linked_role'),
        max_session_duration=pulumi.get(__ret__, 'max_session_duration'),
        policies=pulumi.get(__ret__, 'policies'),
        role_id=pulumi.get(__ret__, 'role_id'),
        role_name=pulumi.get(__ret__, 'role_name'),
        tags=pulumi.get(__ret__, 'tags'),
        trn=pulumi.get(__ret__, 'trn'),
        trust_policy_document=pulumi.get(__ret__, 'trust_policy_document'),
        update_date=pulumi.get(__ret__, 'update_date'))
def get_role_output(id: Optional[pulumi.Input[builtins.str]] = None,
                    opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRoleResult]:
    """
    Data Source schema for Byteplus::IAM::Role


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:iam/getRole:getRole', __args__, opts=opts, typ=GetRoleResult)
    return __ret__.apply(lambda __response__: GetRoleResult(
        create_date=pulumi.get(__response__, 'create_date'),
        description=pulumi.get(__response__, 'description'),
        display_name=pulumi.get(__response__, 'display_name'),
        id=pulumi.get(__response__, 'id'),
        is_service_linked_role=pulumi.get(__response__, 'is_service_linked_role'),
        max_session_duration=pulumi.get(__response__, 'max_session_duration'),
        policies=pulumi.get(__response__, 'policies'),
        role_id=pulumi.get(__response__, 'role_id'),
        role_name=pulumi.get(__response__, 'role_name'),
        tags=pulumi.get(__response__, 'tags'),
        trn=pulumi.get(__response__, 'trn'),
        trust_policy_document=pulumi.get(__response__, 'trust_policy_document'),
        update_date=pulumi.get(__response__, 'update_date')))
