# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = [
    'GetSessionContextResult',
    'AwaitableGetSessionContextResult',
    'get_session_context',
]

@pulumi.output_type
class GetSessionContextResult:
    """
    A collection of values returned by getSessionContext.
    """
    def __init__(__self__, arn=None, id=None, issuer_arn=None, issuer_id=None, issuer_name=None, session_name=None):
        if arn and not isinstance(arn, str):
            raise TypeError("Expected argument 'arn' to be a str")
        pulumi.set(__self__, "arn", arn)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if issuer_arn and not isinstance(issuer_arn, str):
            raise TypeError("Expected argument 'issuer_arn' to be a str")
        pulumi.set(__self__, "issuer_arn", issuer_arn)
        if issuer_id and not isinstance(issuer_id, str):
            raise TypeError("Expected argument 'issuer_id' to be a str")
        pulumi.set(__self__, "issuer_id", issuer_id)
        if issuer_name and not isinstance(issuer_name, str):
            raise TypeError("Expected argument 'issuer_name' to be a str")
        pulumi.set(__self__, "issuer_name", issuer_name)
        if session_name and not isinstance(session_name, str):
            raise TypeError("Expected argument 'session_name' to be a str")
        pulumi.set(__self__, "session_name", session_name)

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

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="issuerArn")
    def issuer_arn(self) -> str:
        """
        IAM source role ARN if `arn` corresponds to an STS assumed role. Otherwise, `issuer_arn` is equal to `arn`.
        """
        return pulumi.get(self, "issuer_arn")

    @property
    @pulumi.getter(name="issuerId")
    def issuer_id(self) -> str:
        """
        Unique identifier of the IAM role that issues the STS assumed role.
        """
        return pulumi.get(self, "issuer_id")

    @property
    @pulumi.getter(name="issuerName")
    def issuer_name(self) -> str:
        """
        Name of the source role. Only available if `arn` corresponds to an STS assumed role.
        """
        return pulumi.get(self, "issuer_name")

    @property
    @pulumi.getter(name="sessionName")
    def session_name(self) -> str:
        """
        Name of the STS session. Only available if `arn` corresponds to an STS assumed role.
        """
        return pulumi.get(self, "session_name")


class AwaitableGetSessionContextResult(GetSessionContextResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSessionContextResult(
            arn=self.arn,
            id=self.id,
            issuer_arn=self.issuer_arn,
            issuer_id=self.issuer_id,
            issuer_name=self.issuer_name,
            session_name=self.session_name)


def get_session_context(arn: Optional[str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSessionContextResult:
    """
    Use this data source to access information about an existing resource.

    :param str arn: ARN for an assumed role.
    """
    __args__ = dict()
    __args__['arn'] = arn
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('aws:iam/getSessionContext:getSessionContext', __args__, opts=opts, typ=GetSessionContextResult).value

    return AwaitableGetSessionContextResult(
        arn=__ret__.arn,
        id=__ret__.id,
        issuer_arn=__ret__.issuer_arn,
        issuer_id=__ret__.issuer_id,
        issuer_name=__ret__.issuer_name,
        session_name=__ret__.session_name)
