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

__all__ = [
    'GetIamRoleResult',
    'AwaitableGetIamRoleResult',
    'get_iam_role',
    'get_iam_role_output',
]

@pulumi.output_type
class GetIamRoleResult:
    """
    A collection of values returned by getIamRole.
    """
    def __init__(__self__, description=None, editable=None, id=None, labels=None, name=None, permissions=None, policy=None, timeouts=None):
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if editable and not isinstance(editable, bool):
            raise TypeError("Expected argument 'editable' to be a bool")
        pulumi.set(__self__, "editable", editable)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if labels and not isinstance(labels, dict):
            raise TypeError("Expected argument 'labels' to be a dict")
        pulumi.set(__self__, "labels", labels)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if permissions and not isinstance(permissions, list):
            raise TypeError("Expected argument 'permissions' to be a list")
        pulumi.set(__self__, "permissions", permissions)
        if policy and not isinstance(policy, dict):
            raise TypeError("Expected argument 'policy' to be a dict")
        pulumi.set(__self__, "policy", policy)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        A free-form text describing the IAM Role
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def editable(self) -> bool:
        """
        Defines if IAM Role Policy is editable or not.
        """
        return pulumi.get(self, "editable")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The role ID to match (conflicts with `name`).
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def labels(self) -> Mapping[str, str]:
        """
        IAM Role labels.
        """
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        the role name to match (conflicts with `id`).
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def permissions(self) -> Sequence[str]:
        """
        IAM Role permissions.
        """
        return pulumi.get(self, "permissions")

    @property
    @pulumi.getter
    def policy(self) -> 'outputs.GetIamRolePolicyResult':
        """
        IAM Policy.
        """
        return pulumi.get(self, "policy")

    @property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.GetIamRoleTimeoutsResult']:
        return pulumi.get(self, "timeouts")


class AwaitableGetIamRoleResult(GetIamRoleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetIamRoleResult(
            description=self.description,
            editable=self.editable,
            id=self.id,
            labels=self.labels,
            name=self.name,
            permissions=self.permissions,
            policy=self.policy,
            timeouts=self.timeouts)


def get_iam_role(id: Optional[str] = None,
                 name: Optional[str] = None,
                 timeouts: Optional[Union['GetIamRoleTimeoutsArgs', 'GetIamRoleTimeoutsArgsDict']] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIamRoleResult:
    """
    Fetch Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Role.

    Corresponding resource: exoscale_iam_role.


    :param str id: The role ID to match (conflicts with `name`).
    :param str name: the role name to match (conflicts with `id`).
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['timeouts'] = timeouts
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('exoscale:index/getIamRole:getIamRole', __args__, opts=opts, typ=GetIamRoleResult).value

    return AwaitableGetIamRoleResult(
        description=pulumi.get(__ret__, 'description'),
        editable=pulumi.get(__ret__, 'editable'),
        id=pulumi.get(__ret__, 'id'),
        labels=pulumi.get(__ret__, 'labels'),
        name=pulumi.get(__ret__, 'name'),
        permissions=pulumi.get(__ret__, 'permissions'),
        policy=pulumi.get(__ret__, 'policy'),
        timeouts=pulumi.get(__ret__, 'timeouts'))
def get_iam_role_output(id: Optional[pulumi.Input[Optional[str]]] = None,
                        name: Optional[pulumi.Input[Optional[str]]] = None,
                        timeouts: Optional[pulumi.Input[Optional[Union['GetIamRoleTimeoutsArgs', 'GetIamRoleTimeoutsArgsDict']]]] = None,
                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetIamRoleResult]:
    """
    Fetch Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Role.

    Corresponding resource: exoscale_iam_role.


    :param str id: The role ID to match (conflicts with `name`).
    :param str name: the role name to match (conflicts with `id`).
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['timeouts'] = timeouts
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('exoscale:index/getIamRole:getIamRole', __args__, opts=opts, typ=GetIamRoleResult)
    return __ret__.apply(lambda __response__: GetIamRoleResult(
        description=pulumi.get(__response__, 'description'),
        editable=pulumi.get(__response__, 'editable'),
        id=pulumi.get(__response__, 'id'),
        labels=pulumi.get(__response__, 'labels'),
        name=pulumi.get(__response__, 'name'),
        permissions=pulumi.get(__response__, 'permissions'),
        policy=pulumi.get(__response__, 'policy'),
        timeouts=pulumi.get(__response__, 'timeouts')))
