# 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__ = [
    'GetAlloydbomniUserResult',
    'AwaitableGetAlloydbomniUserResult',
    'get_alloydbomni_user',
    'get_alloydbomni_user_output',
]

@pulumi.output_type
class GetAlloydbomniUserResult:
    """
    A collection of values returned by getAlloydbomniUser.
    """
    def __init__(__self__, access_cert=None, access_key=None, id=None, password=None, pg_allow_replication=None, project=None, service_name=None, type=None, username=None):
        if access_cert and not isinstance(access_cert, str):
            raise TypeError("Expected argument 'access_cert' to be a str")
        pulumi.set(__self__, "access_cert", access_cert)
        if access_key and not isinstance(access_key, str):
            raise TypeError("Expected argument 'access_key' to be a str")
        pulumi.set(__self__, "access_key", access_key)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if pg_allow_replication and not isinstance(pg_allow_replication, bool):
            raise TypeError("Expected argument 'pg_allow_replication' to be a bool")
        pulumi.set(__self__, "pg_allow_replication", pg_allow_replication)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if service_name and not isinstance(service_name, str):
            raise TypeError("Expected argument 'service_name' to be a str")
        pulumi.set(__self__, "service_name", service_name)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)

    @property
    @pulumi.getter(name="accessCert")
    def access_cert(self) -> builtins.str:
        """
        The access certificate for the servie user.
        """
        return pulumi.get(self, "access_cert")

    @property
    @pulumi.getter(name="accessKey")
    def access_key(self) -> builtins.str:
        """
        The access certificate key for the service user.
        """
        return pulumi.get(self, "access_key")

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

    @property
    @pulumi.getter
    def password(self) -> builtins.str:
        """
        The password of the service user.
        """
        return pulumi.get(self, "password")

    @property
    @pulumi.getter(name="pgAllowReplication")
    def pg_allow_replication(self) -> builtins.bool:
        """
        Allows replication. For the default avnadmin user this attribute is required and is always `true`.
        """
        return pulumi.get(self, "pg_allow_replication")

    @property
    @pulumi.getter
    def project(self) -> builtins.str:
        """
        The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> builtins.str:
        """
        The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        The service user account type, either primary or regular.
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter
    def username(self) -> builtins.str:
        """
        The name of the service user for this service. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "username")


class AwaitableGetAlloydbomniUserResult(GetAlloydbomniUserResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAlloydbomniUserResult(
            access_cert=self.access_cert,
            access_key=self.access_key,
            id=self.id,
            password=self.password,
            pg_allow_replication=self.pg_allow_replication,
            project=self.project,
            service_name=self.service_name,
            type=self.type,
            username=self.username)


def get_alloydbomni_user(project: Optional[builtins.str] = None,
                         service_name: Optional[builtins.str] = None,
                         username: Optional[builtins.str] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAlloydbomniUserResult:
    """
    Gets information about an Aiven for AlloyDB Omni service user.

    **This resource is in the beta stage and may change without notice.** Set
    the `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.


    :param builtins.str project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param builtins.str service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param builtins.str username: The name of the service user for this service. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    """
    __args__ = dict()
    __args__['project'] = project
    __args__['serviceName'] = service_name
    __args__['username'] = username
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('aiven:index/getAlloydbomniUser:getAlloydbomniUser', __args__, opts=opts, typ=GetAlloydbomniUserResult).value

    return AwaitableGetAlloydbomniUserResult(
        access_cert=pulumi.get(__ret__, 'access_cert'),
        access_key=pulumi.get(__ret__, 'access_key'),
        id=pulumi.get(__ret__, 'id'),
        password=pulumi.get(__ret__, 'password'),
        pg_allow_replication=pulumi.get(__ret__, 'pg_allow_replication'),
        project=pulumi.get(__ret__, 'project'),
        service_name=pulumi.get(__ret__, 'service_name'),
        type=pulumi.get(__ret__, 'type'),
        username=pulumi.get(__ret__, 'username'))
def get_alloydbomni_user_output(project: Optional[pulumi.Input[builtins.str]] = None,
                                service_name: Optional[pulumi.Input[builtins.str]] = None,
                                username: Optional[pulumi.Input[builtins.str]] = None,
                                opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetAlloydbomniUserResult]:
    """
    Gets information about an Aiven for AlloyDB Omni service user.

    **This resource is in the beta stage and may change without notice.** Set
    the `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.


    :param builtins.str project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param builtins.str service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param builtins.str username: The name of the service user for this service. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    """
    __args__ = dict()
    __args__['project'] = project
    __args__['serviceName'] = service_name
    __args__['username'] = username
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('aiven:index/getAlloydbomniUser:getAlloydbomniUser', __args__, opts=opts, typ=GetAlloydbomniUserResult)
    return __ret__.apply(lambda __response__: GetAlloydbomniUserResult(
        access_cert=pulumi.get(__response__, 'access_cert'),
        access_key=pulumi.get(__response__, 'access_key'),
        id=pulumi.get(__response__, 'id'),
        password=pulumi.get(__response__, 'password'),
        pg_allow_replication=pulumi.get(__response__, 'pg_allow_replication'),
        project=pulumi.get(__response__, 'project'),
        service_name=pulumi.get(__response__, 'service_name'),
        type=pulumi.get(__response__, 'type'),
        username=pulumi.get(__response__, 'username')))
