# 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
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__ = [
    'GetKeyValueConnectionInfoResult',
    'AwaitableGetKeyValueConnectionInfoResult',
    'get_key_value_connection_info',
    'get_key_value_connection_info_output',
]

@pulumi.output_type
class GetKeyValueConnectionInfoResult:
    """
    A Key Value instance
    """
    def __init__(__self__, cli_command=None, external_connection_string=None, internal_connection_string=None):
        if cli_command and not isinstance(cli_command, str):
            raise TypeError("Expected argument 'cli_command' to be a str")
        pulumi.set(__self__, "cli_command", cli_command)
        if external_connection_string and not isinstance(external_connection_string, str):
            raise TypeError("Expected argument 'external_connection_string' to be a str")
        pulumi.set(__self__, "external_connection_string", external_connection_string)
        if internal_connection_string and not isinstance(internal_connection_string, str):
            raise TypeError("Expected argument 'internal_connection_string' to be a str")
        pulumi.set(__self__, "internal_connection_string", internal_connection_string)

    @property
    @pulumi.getter(name="cliCommand")
    def cli_command(self) -> builtins.str:
        """
        The CLI (redis-cli or valkey-cli) command to connect to the Key Value instance
        """
        return pulumi.get(self, "cli_command")

    @property
    @pulumi.getter(name="externalConnectionString")
    def external_connection_string(self) -> builtins.str:
        """
        The connection string to use from outside Render
        """
        return pulumi.get(self, "external_connection_string")

    @property
    @pulumi.getter(name="internalConnectionString")
    def internal_connection_string(self) -> builtins.str:
        """
        The connection string to use from within Render
        """
        return pulumi.get(self, "internal_connection_string")


class AwaitableGetKeyValueConnectionInfoResult(GetKeyValueConnectionInfoResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetKeyValueConnectionInfoResult(
            cli_command=self.cli_command,
            external_connection_string=self.external_connection_string,
            internal_connection_string=self.internal_connection_string)


def get_key_value_connection_info(key_value_id: Optional[builtins.str] = None,
                                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetKeyValueConnectionInfoResult:
    """
    Use this data source to access information about an existing resource.
    """
    __args__ = dict()
    __args__['keyValueId'] = key_value_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('render:key-value:getKeyValueConnectionInfo', __args__, opts=opts, typ=GetKeyValueConnectionInfoResult).value

    return AwaitableGetKeyValueConnectionInfoResult(
        cli_command=pulumi.get(__ret__, 'cli_command'),
        external_connection_string=pulumi.get(__ret__, 'external_connection_string'),
        internal_connection_string=pulumi.get(__ret__, 'internal_connection_string'))
def get_key_value_connection_info_output(key_value_id: Optional[pulumi.Input[builtins.str]] = None,
                                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetKeyValueConnectionInfoResult]:
    """
    Use this data source to access information about an existing resource.
    """
    __args__ = dict()
    __args__['keyValueId'] = key_value_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('render:key-value:getKeyValueConnectionInfo', __args__, opts=opts, typ=GetKeyValueConnectionInfoResult)
    return __ret__.apply(lambda __response__: GetKeyValueConnectionInfoResult(
        cli_command=pulumi.get(__response__, 'cli_command'),
        external_connection_string=pulumi.get(__response__, 'external_connection_string'),
        internal_connection_string=pulumi.get(__response__, 'internal_connection_string')))
