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

__all__ = [
    'GetDatabaseResult',
    'AwaitableGetDatabaseResult',
    'get_database',
    'get_database_output',
]

@pulumi.output_type
class GetDatabaseResult:
    """
    A collection of values returned by getDatabase.
    """
    def __init__(__self__, dns_endpoint=None, endpoint=None, engine=None, firewall_id=None, id=None, name=None, network_id=None, nodes=None, password=None, port=None, region=None, size=None, status=None, username=None, version=None):
        if dns_endpoint and not isinstance(dns_endpoint, str):
            raise TypeError("Expected argument 'dns_endpoint' to be a str")
        pulumi.set(__self__, "dns_endpoint", dns_endpoint)
        if endpoint and not isinstance(endpoint, str):
            raise TypeError("Expected argument 'endpoint' to be a str")
        pulumi.set(__self__, "endpoint", endpoint)
        if engine and not isinstance(engine, str):
            raise TypeError("Expected argument 'engine' to be a str")
        pulumi.set(__self__, "engine", engine)
        if firewall_id and not isinstance(firewall_id, str):
            raise TypeError("Expected argument 'firewall_id' to be a str")
        pulumi.set(__self__, "firewall_id", firewall_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if network_id and not isinstance(network_id, str):
            raise TypeError("Expected argument 'network_id' to be a str")
        pulumi.set(__self__, "network_id", network_id)
        if nodes and not isinstance(nodes, int):
            raise TypeError("Expected argument 'nodes' to be a int")
        pulumi.set(__self__, "nodes", nodes)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        pulumi.set(__self__, "region", region)
        if size and not isinstance(size, str):
            raise TypeError("Expected argument 'size' to be a str")
        pulumi.set(__self__, "size", size)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)
        if version and not isinstance(version, str):
            raise TypeError("Expected argument 'version' to be a str")
        pulumi.set(__self__, "version", version)

    @property
    @pulumi.getter(name="dnsEndpoint")
    def dns_endpoint(self) -> str:
        """
        The DNS endpoint of the database
        """
        return pulumi.get(self, "dns_endpoint")

    @property
    @pulumi.getter
    def endpoint(self) -> str:
        """
        The endpoint of the database
        """
        return pulumi.get(self, "endpoint")

    @property
    @pulumi.getter
    def engine(self) -> str:
        """
        The engine of the database
        """
        return pulumi.get(self, "engine")

    @property
    @pulumi.getter(name="firewallId")
    def firewall_id(self) -> str:
        """
        The firewall id of the Database
        """
        return pulumi.get(self, "firewall_id")

    @property
    @pulumi.getter
    def id(self) -> Optional[str]:
        """
        The ID of the Database
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> Optional[str]:
        """
        The name of the Database
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="networkId")
    def network_id(self) -> str:
        """
        The network id of the Database
        """
        return pulumi.get(self, "network_id")

    @property
    @pulumi.getter
    def nodes(self) -> int:
        """
        Count of nodes
        """
        return pulumi.get(self, "nodes")

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

    @property
    @pulumi.getter
    def port(self) -> int:
        """
        The port of the database
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter
    def region(self) -> str:
        """
        The region of an existing Database
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter
    def size(self) -> str:
        """
        Size of the database
        """
        return pulumi.get(self, "size")

    @property
    @pulumi.getter
    def status(self) -> str:
        """
        The status of the database
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def username(self) -> str:
        """
        The username of the database
        """
        return pulumi.get(self, "username")

    @property
    @pulumi.getter
    def version(self) -> str:
        """
        The version of the database
        """
        return pulumi.get(self, "version")


class AwaitableGetDatabaseResult(GetDatabaseResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDatabaseResult(
            dns_endpoint=self.dns_endpoint,
            endpoint=self.endpoint,
            engine=self.engine,
            firewall_id=self.firewall_id,
            id=self.id,
            name=self.name,
            network_id=self.network_id,
            nodes=self.nodes,
            password=self.password,
            port=self.port,
            region=self.region,
            size=self.size,
            status=self.status,
            username=self.username,
            version=self.version)


def get_database(id: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatabaseResult:
    """
    Get information of an Database for use in other resources. This data source provides all of the Database's properties as configured on your Civo account.

    Note: This data source returns a single Database. When specifying a name, an error will be raised if more than one Databases with the same name found.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_civo as civo

    test = civo.get_database(name="test-database",
        region="LON1")
    ```


    :param str id: The ID of the Database
    :param str name: The name of the Database
    :param str region: The region of an existing Database
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['region'] = region
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('civo:index/getDatabase:getDatabase', __args__, opts=opts, typ=GetDatabaseResult).value

    return AwaitableGetDatabaseResult(
        dns_endpoint=pulumi.get(__ret__, 'dns_endpoint'),
        endpoint=pulumi.get(__ret__, 'endpoint'),
        engine=pulumi.get(__ret__, 'engine'),
        firewall_id=pulumi.get(__ret__, 'firewall_id'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        network_id=pulumi.get(__ret__, 'network_id'),
        nodes=pulumi.get(__ret__, 'nodes'),
        password=pulumi.get(__ret__, 'password'),
        port=pulumi.get(__ret__, 'port'),
        region=pulumi.get(__ret__, 'region'),
        size=pulumi.get(__ret__, 'size'),
        status=pulumi.get(__ret__, 'status'),
        username=pulumi.get(__ret__, 'username'),
        version=pulumi.get(__ret__, 'version'))


@_utilities.lift_output_func(get_database)
def get_database_output(id: Optional[pulumi.Input[Optional[str]]] = None,
                        name: Optional[pulumi.Input[Optional[str]]] = None,
                        region: Optional[pulumi.Input[Optional[str]]] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatabaseResult]:
    """
    Get information of an Database for use in other resources. This data source provides all of the Database's properties as configured on your Civo account.

    Note: This data source returns a single Database. When specifying a name, an error will be raised if more than one Databases with the same name found.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_civo as civo

    test = civo.get_database(name="test-database",
        region="LON1")
    ```


    :param str id: The ID of the Database
    :param str name: The name of the Database
    :param str region: The region of an existing Database
    """
    ...
