# 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 as _builtins
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__ = [
    'GetBackendIssuersResult',
    'AwaitableGetBackendIssuersResult',
    'get_backend_issuers',
    'get_backend_issuers_output',
]

@pulumi.output_type
class GetBackendIssuersResult:
    """
    A collection of values returned by getBackendIssuers.
    """
    def __init__(__self__, backend=None, id=None, key_info=None, key_info_json=None, keys=None, namespace=None):
        if backend and not isinstance(backend, str):
            raise TypeError("Expected argument 'backend' to be a str")
        pulumi.set(__self__, "backend", backend)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if key_info and not isinstance(key_info, dict):
            raise TypeError("Expected argument 'key_info' to be a dict")
        pulumi.set(__self__, "key_info", key_info)
        if key_info_json and not isinstance(key_info_json, str):
            raise TypeError("Expected argument 'key_info_json' to be a str")
        pulumi.set(__self__, "key_info_json", key_info_json)
        if keys and not isinstance(keys, list):
            raise TypeError("Expected argument 'keys' to be a list")
        pulumi.set(__self__, "keys", keys)
        if namespace and not isinstance(namespace, str):
            raise TypeError("Expected argument 'namespace' to be a str")
        pulumi.set(__self__, "namespace", namespace)

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

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

    @_builtins.property
    @pulumi.getter(name="keyInfo")
    def key_info(self) -> Mapping[str, _builtins.str]:
        """
        Map of issuer strings read from Vault.
        """
        return pulumi.get(self, "key_info")

    @_builtins.property
    @pulumi.getter(name="keyInfoJson")
    def key_info_json(self) -> _builtins.str:
        """
        JSON-encoded issuer data read from Vault.
        """
        return pulumi.get(self, "key_info_json")

    @_builtins.property
    @pulumi.getter
    def keys(self) -> Sequence[_builtins.str]:
        """
        Keys used by issuers under the backend path.
        """
        return pulumi.get(self, "keys")

    @_builtins.property
    @pulumi.getter
    def namespace(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "namespace")


class AwaitableGetBackendIssuersResult(GetBackendIssuersResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetBackendIssuersResult(
            backend=self.backend,
            id=self.id,
            key_info=self.key_info,
            key_info_json=self.key_info_json,
            keys=self.keys,
            namespace=self.namespace)


def get_backend_issuers(backend: Optional[_builtins.str] = None,
                        namespace: Optional[_builtins.str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBackendIssuersResult:
    """
    Lists all issuers under a particular mount.

    > **Important** All data retrieved from Vault will be
    written in cleartext to state file generated by Terraform, will appear in
    the console output when Terraform runs, and may be included in plan files
    if secrets are interpolated into any resource attributes.
    Protect these artifacts accordingly. See
    the main provider documentation
    for more details.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vault as vault

    pki = vault.Mount("pki",
        path="pki",
        type="pki",
        description="PKI secret engine mount")
    root = vault.pkisecret.SecretBackendRootCert("root",
        backend=pki.path,
        type="internal",
        common_name="example",
        ttl="86400",
        issuer_name="example")
    test = vault.pkiSecret.get_backend_issuers_output(backend=root.backend)
    ```


    :param _builtins.str backend: The path to the PKI secret backend to
           read the issuers from, with no leading or trailing `/`s.
    :param _builtins.str namespace: The namespace of the target resource.
           The value should not contain leading or trailing forward slashes.
           The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
           *Available only for Vault Enterprise*.
    """
    __args__ = dict()
    __args__['backend'] = backend
    __args__['namespace'] = namespace
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('vault:pkiSecret/getBackendIssuers:getBackendIssuers', __args__, opts=opts, typ=GetBackendIssuersResult).value

    return AwaitableGetBackendIssuersResult(
        backend=pulumi.get(__ret__, 'backend'),
        id=pulumi.get(__ret__, 'id'),
        key_info=pulumi.get(__ret__, 'key_info'),
        key_info_json=pulumi.get(__ret__, 'key_info_json'),
        keys=pulumi.get(__ret__, 'keys'),
        namespace=pulumi.get(__ret__, 'namespace'))
def get_backend_issuers_output(backend: Optional[pulumi.Input[_builtins.str]] = None,
                               namespace: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                               opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetBackendIssuersResult]:
    """
    Lists all issuers under a particular mount.

    > **Important** All data retrieved from Vault will be
    written in cleartext to state file generated by Terraform, will appear in
    the console output when Terraform runs, and may be included in plan files
    if secrets are interpolated into any resource attributes.
    Protect these artifacts accordingly. See
    the main provider documentation
    for more details.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vault as vault

    pki = vault.Mount("pki",
        path="pki",
        type="pki",
        description="PKI secret engine mount")
    root = vault.pkisecret.SecretBackendRootCert("root",
        backend=pki.path,
        type="internal",
        common_name="example",
        ttl="86400",
        issuer_name="example")
    test = vault.pkiSecret.get_backend_issuers_output(backend=root.backend)
    ```


    :param _builtins.str backend: The path to the PKI secret backend to
           read the issuers from, with no leading or trailing `/`s.
    :param _builtins.str namespace: The namespace of the target resource.
           The value should not contain leading or trailing forward slashes.
           The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
           *Available only for Vault Enterprise*.
    """
    __args__ = dict()
    __args__['backend'] = backend
    __args__['namespace'] = namespace
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('vault:pkiSecret/getBackendIssuers:getBackendIssuers', __args__, opts=opts, typ=GetBackendIssuersResult)
    return __ret__.apply(lambda __response__: GetBackendIssuersResult(
        backend=pulumi.get(__response__, 'backend'),
        id=pulumi.get(__response__, 'id'),
        key_info=pulumi.get(__response__, 'key_info'),
        key_info_json=pulumi.get(__response__, 'key_info_json'),
        keys=pulumi.get(__response__, 'keys'),
        namespace=pulumi.get(__response__, 'namespace')))
