# 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 Union
from .. import utilities, tables

class GetDatabaseResult:
    """
    A collection of values returned by getDatabase.
    """
    def __init__(__self__, collation=None, elastic_pool_id=None, id=None, license_type=None, max_size_gb=None, name=None, read_replica_count=None, read_scale=None, server_id=None, sku_name=None, tags=None, zone_redundant=None):
        if collation and not isinstance(collation, str):
            raise TypeError("Expected argument 'collation' to be a str")
        __self__.collation = collation
        """
        The collation of the database.
        """
        if elastic_pool_id and not isinstance(elastic_pool_id, str):
            raise TypeError("Expected argument 'elastic_pool_id' to be a str")
        __self__.elastic_pool_id = elastic_pool_id
        """
        The id of the elastic pool containing this database.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if license_type and not isinstance(license_type, str):
            raise TypeError("Expected argument 'license_type' to be a str")
        __self__.license_type = license_type
        """
        The license type to apply for this database.
        """
        if max_size_gb and not isinstance(max_size_gb, float):
            raise TypeError("Expected argument 'max_size_gb' to be a float")
        __self__.max_size_gb = max_size_gb
        """
        The max size of the database in gigabytes.
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        if read_replica_count and not isinstance(read_replica_count, float):
            raise TypeError("Expected argument 'read_replica_count' to be a float")
        __self__.read_replica_count = read_replica_count
        """
        The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed.
        """
        if read_scale and not isinstance(read_scale, bool):
            raise TypeError("Expected argument 'read_scale' to be a bool")
        __self__.read_scale = read_scale
        """
        If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica.
        """
        if server_id and not isinstance(server_id, str):
            raise TypeError("Expected argument 'server_id' to be a str")
        __self__.server_id = server_id
        if sku_name and not isinstance(sku_name, str):
            raise TypeError("Expected argument 'sku_name' to be a str")
        __self__.sku_name = sku_name
        """
        The name of the sku of the database.
        """
        if tags and not isinstance(tags, dict):
            raise TypeError("Expected argument 'tags' to be a dict")
        __self__.tags = tags
        """
        A mapping of tags to assign to the resource.
        """
        if zone_redundant and not isinstance(zone_redundant, bool):
            raise TypeError("Expected argument 'zone_redundant' to be a bool")
        __self__.zone_redundant = zone_redundant
        """
        Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
        """
class AwaitableGetDatabaseResult(GetDatabaseResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDatabaseResult(
            collation=self.collation,
            elastic_pool_id=self.elastic_pool_id,
            id=self.id,
            license_type=self.license_type,
            max_size_gb=self.max_size_gb,
            name=self.name,
            read_replica_count=self.read_replica_count,
            read_scale=self.read_scale,
            server_id=self.server_id,
            sku_name=self.sku_name,
            tags=self.tags,
            zone_redundant=self.zone_redundant)

def get_database(name=None,server_id=None,opts=None):
    """
    Use this data source to access information about an existing SQL database.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.mssql.get_database(name="example-mssql-db",
        server_id="example-mssql-server-id")
    pulumi.export("databaseId", example.id)
    ```


    :param str name: The name of the Ms SQL Database.
    :param str server_id: The id of the Ms SQL Server on which to create the database.
    """
    __args__ = dict()


    __args__['name'] = name
    __args__['serverId'] = server_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('azure:mssql/getDatabase:getDatabase', __args__, opts=opts).value

    return AwaitableGetDatabaseResult(
        collation=__ret__.get('collation'),
        elastic_pool_id=__ret__.get('elasticPoolId'),
        id=__ret__.get('id'),
        license_type=__ret__.get('licenseType'),
        max_size_gb=__ret__.get('maxSizeGb'),
        name=__ret__.get('name'),
        read_replica_count=__ret__.get('readReplicaCount'),
        read_scale=__ret__.get('readScale'),
        server_id=__ret__.get('serverId'),
        sku_name=__ret__.get('skuName'),
        tags=__ret__.get('tags'),
        zone_redundant=__ret__.get('zoneRedundant'))
