# 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 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
from . import outputs

__all__ = [
    'GetInstanceResult',
    'AwaitableGetInstanceResult',
    'get_instance',
    'get_instance_output',
]

@pulumi.output_type
class GetInstanceResult:
    """
    A collection of values returned by getInstance.
    """
    def __init__(__self__, charge_detail=None, created_time=None, db_engine_version=None, db_minor_version=None, db_revision_version=None, deletion_protection=None, endpoints=None, id=None, instance_id=None, instance_name=None, instance_status=None, lower_case_table_names=None, maintenance_window=None, node_number=None, node_spec=None, nodes=None, number=None, port=None, pre_paid_storage_in_gb=None, project_name=None, spec_family=None, storage_charge_type=None, storage_used_gi_b=None, subnet_id=None, super_account_name=None, super_account_password=None, tags=None, template_id=None, time_zone=None, vpc_id=None, zone_ids=None):
        if charge_detail and not isinstance(charge_detail, dict):
            raise TypeError("Expected argument 'charge_detail' to be a dict")
        pulumi.set(__self__, "charge_detail", charge_detail)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if db_engine_version and not isinstance(db_engine_version, str):
            raise TypeError("Expected argument 'db_engine_version' to be a str")
        pulumi.set(__self__, "db_engine_version", db_engine_version)
        if db_minor_version and not isinstance(db_minor_version, str):
            raise TypeError("Expected argument 'db_minor_version' to be a str")
        pulumi.set(__self__, "db_minor_version", db_minor_version)
        if db_revision_version and not isinstance(db_revision_version, str):
            raise TypeError("Expected argument 'db_revision_version' to be a str")
        pulumi.set(__self__, "db_revision_version", db_revision_version)
        if deletion_protection and not isinstance(deletion_protection, str):
            raise TypeError("Expected argument 'deletion_protection' to be a str")
        pulumi.set(__self__, "deletion_protection", deletion_protection)
        if endpoints and not isinstance(endpoints, list):
            raise TypeError("Expected argument 'endpoints' to be a list")
        pulumi.set(__self__, "endpoints", endpoints)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        if instance_name and not isinstance(instance_name, str):
            raise TypeError("Expected argument 'instance_name' to be a str")
        pulumi.set(__self__, "instance_name", instance_name)
        if instance_status and not isinstance(instance_status, str):
            raise TypeError("Expected argument 'instance_status' to be a str")
        pulumi.set(__self__, "instance_status", instance_status)
        if lower_case_table_names and not isinstance(lower_case_table_names, str):
            raise TypeError("Expected argument 'lower_case_table_names' to be a str")
        pulumi.set(__self__, "lower_case_table_names", lower_case_table_names)
        if maintenance_window and not isinstance(maintenance_window, dict):
            raise TypeError("Expected argument 'maintenance_window' to be a dict")
        pulumi.set(__self__, "maintenance_window", maintenance_window)
        if node_number and not isinstance(node_number, int):
            raise TypeError("Expected argument 'node_number' to be a int")
        pulumi.set(__self__, "node_number", node_number)
        if node_spec and not isinstance(node_spec, str):
            raise TypeError("Expected argument 'node_spec' to be a str")
        pulumi.set(__self__, "node_spec", node_spec)
        if nodes and not isinstance(nodes, list):
            raise TypeError("Expected argument 'nodes' to be a list")
        pulumi.set(__self__, "nodes", nodes)
        if number and not isinstance(number, int):
            raise TypeError("Expected argument 'number' to be a int")
        pulumi.set(__self__, "number", number)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if pre_paid_storage_in_gb and not isinstance(pre_paid_storage_in_gb, int):
            raise TypeError("Expected argument 'pre_paid_storage_in_gb' to be a int")
        pulumi.set(__self__, "pre_paid_storage_in_gb", pre_paid_storage_in_gb)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if spec_family and not isinstance(spec_family, str):
            raise TypeError("Expected argument 'spec_family' to be a str")
        pulumi.set(__self__, "spec_family", spec_family)
        if storage_charge_type and not isinstance(storage_charge_type, str):
            raise TypeError("Expected argument 'storage_charge_type' to be a str")
        pulumi.set(__self__, "storage_charge_type", storage_charge_type)
        if storage_used_gi_b and not isinstance(storage_used_gi_b, float):
            raise TypeError("Expected argument 'storage_used_gi_b' to be a float")
        pulumi.set(__self__, "storage_used_gi_b", storage_used_gi_b)
        if subnet_id and not isinstance(subnet_id, str):
            raise TypeError("Expected argument 'subnet_id' to be a str")
        pulumi.set(__self__, "subnet_id", subnet_id)
        if super_account_name and not isinstance(super_account_name, str):
            raise TypeError("Expected argument 'super_account_name' to be a str")
        pulumi.set(__self__, "super_account_name", super_account_name)
        if super_account_password and not isinstance(super_account_password, str):
            raise TypeError("Expected argument 'super_account_password' to be a str")
        pulumi.set(__self__, "super_account_password", super_account_password)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if template_id and not isinstance(template_id, str):
            raise TypeError("Expected argument 'template_id' to be a str")
        pulumi.set(__self__, "template_id", template_id)
        if time_zone and not isinstance(time_zone, str):
            raise TypeError("Expected argument 'time_zone' to be a str")
        pulumi.set(__self__, "time_zone", time_zone)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)
        if zone_ids and not isinstance(zone_ids, str):
            raise TypeError("Expected argument 'zone_ids' to be a str")
        pulumi.set(__self__, "zone_ids", zone_ids)

    @property
    @pulumi.getter(name="chargeDetail")
    def charge_detail(self) -> 'outputs.GetInstanceChargeDetailResult':
        """
        计费详细信息。
        """
        return pulumi.get(self, "charge_detail")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        实例的创建时间，格式：YYYY-MM-DDTHH:MM:SSZ（UTC 时间）。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="dbEngineVersion")
    def db_engine_version(self) -> builtins.str:
        """
        实例兼容版本。取值范围：MySQL*8*0：表示兼容社区 MySQL 8.0 版本。MySQL*5*7：表示兼容社区 MySQL 5.7 版本。
        """
        return pulumi.get(self, "db_engine_version")

    @property
    @pulumi.getter(name="dbMinorVersion")
    def db_minor_version(self) -> builtins.str:
        """
        根据兼容版本，选择 veDB MySQL 小版本。当 DBEngineVersion 取值为 MySQL*5*7 时，该参数取值默认为 2.0。当 DBEngineVersion 取值为 MySQL*8*0 时，该参数取值范围如下：3.0（默认）：veDB MySQL 稳定版，100% 兼容 MySQL 8.0。3.1：原生支持 HTAP 应用场景，加速复杂查询。3.2：原生支持 HTAP 应用场景，加速复杂查询。
        """
        return pulumi.get(self, "db_minor_version")

    @property
    @pulumi.getter(name="dbRevisionVersion")
    def db_revision_version(self) -> builtins.str:
        """
        实例的内核版本。
        """
        return pulumi.get(self, "db_revision_version")

    @property
    @pulumi.getter(name="deletionProtection")
    def deletion_protection(self) -> builtins.str:
        """
        实例是否开启了删除保护功能。取值范围：enabled：开启。disabled：关闭。
        """
        return pulumi.get(self, "deletion_protection")

    @property
    @pulumi.getter
    def endpoints(self) -> Sequence['outputs.GetInstanceEndpointResult']:
        """
        连接终端的详细信息。
        """
        return pulumi.get(self, "endpoints")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> builtins.str:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter(name="instanceName")
    def instance_name(self) -> builtins.str:
        """
        实例名称。命名规则：不能以数字、中划线（-）开头。只能包含中文、字母、数字、下划线（_）和中划线（-）。长度需在 1~128 个字符内。
        """
        return pulumi.get(self, "instance_name")

    @property
    @pulumi.getter(name="instanceStatus")
    def instance_status(self) -> builtins.str:
        """
        实例状态。
        """
        return pulumi.get(self, "instance_status")

    @property
    @pulumi.getter(name="lowerCaseTableNames")
    def lower_case_table_names(self) -> builtins.str:
        """
        表名是否区分大小写。取值范围：0：表名称大小写敏感，后端根据实际表名存储。1：表名称不区分大小写，后端存储时将表名称统一为小写字母。
        """
        return pulumi.get(self, "lower_case_table_names")

    @property
    @pulumi.getter(name="maintenanceWindow")
    def maintenance_window(self) -> 'outputs.GetInstanceMaintenanceWindowResult':
        """
        实例的可维护时间窗口信息。
        """
        return pulumi.get(self, "maintenance_window")

    @property
    @pulumi.getter(name="nodeNumber")
    def node_number(self) -> builtins.int:
        """
        实例节点数量。取值范围为 2~16 个。
        """
        return pulumi.get(self, "node_number")

    @property
    @pulumi.getter(name="nodeSpec")
    def node_spec(self) -> builtins.str:
        """
        实例的节点规格代码。
        """
        return pulumi.get(self, "node_spec")

    @property
    @pulumi.getter
    def nodes(self) -> Sequence['outputs.GetInstanceNodeResult']:
        """
        实例节点的详细信息。
        """
        return pulumi.get(self, "nodes")

    @property
    @pulumi.getter
    def number(self) -> builtins.int:
        """
        创建的实例数量，取值范围 1~50，默认值为 1。
        """
        return pulumi.get(self, "number")

    @property
    @pulumi.getter
    def port(self) -> builtins.int:
        """
        为实例默认创建的连接终端指定私网端口号。默认取值为 3306，取值范围为 1000~65534。
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter(name="prePaidStorageInGb")
    def pre_paid_storage_in_gb(self) -> builtins.int:
        """
        预付费的存储总容量大小，单位 GiB。
        """
        return pulumi.get(self, "pre_paid_storage_in_gb")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        实例所属的项目名称。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="specFamily")
    def spec_family(self) -> builtins.str:
        """
        实例规格类型，取值：General：通用型。Exclusive：独享型。
        """
        return pulumi.get(self, "spec_family")

    @property
    @pulumi.getter(name="storageChargeType")
    def storage_charge_type(self) -> builtins.str:
        """
        存储计费类型，不传入该参数时，存储计费类型默认与计算计费类型取值一致。取值：PostPaid：按量计费（后付费）。PrePaid：包年包月（预付费）。
        """
        return pulumi.get(self, "storage_charge_type")

    @property
    @pulumi.getter(name="storageUsedGiB")
    def storage_used_gi_b(self) -> builtins.float:
        """
        已使用存储空间大小，单位 GiB。
        """
        return pulumi.get(self, "storage_used_gi_b")

    @property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> builtins.str:
        """
        子网 ID。子网必须属于所选的可用区。
        """
        return pulumi.get(self, "subnet_id")

    @property
    @pulumi.getter(name="superAccountName")
    def super_account_name(self) -> builtins.str:
        """
        高权限用户的账号名称。账号名称需满足以下要求：名称唯一，且长度在 2~32 个字符内。由字母、数字、中划线（-）、下划线（_）组成。以字母开头，以字母或数字结尾。名称内不能包含禁用关键词。
        """
        return pulumi.get(self, "super_account_name")

    @property
    @pulumi.getter(name="superAccountPassword")
    def super_account_password(self) -> builtins.str:
        """
        高权限账号的密码。账号密码需满足以下要求：只能包含大小写字母、数字和特殊字符（如 ~!@#$%^&*_-+=`|(){}[]:;'<>,.?/）。长度需在 8~32 个字符内。至少包含大写字母、小写字母、数字或特殊字符中的 3 种。
        """
        return pulumi.get(self, "super_account_password")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetInstanceTagResult']:
        """
        实例绑定的标签键和标签值数组对象。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="templateId")
    def template_id(self) -> builtins.str:
        """
        参数模板 ID。
        """
        return pulumi.get(self, "template_id")

    @property
    @pulumi.getter(name="timeZone")
    def time_zone(self) -> builtins.str:
        """
        实例的时区。国内所有地域默认时区为 UTC +08:00。
        """
        return pulumi.get(self, "time_zone")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        """
        私有网络（VPC） ID。
        """
        return pulumi.get(self, "vpc_id")

    @property
    @pulumi.getter(name="zoneIds")
    def zone_ids(self) -> builtins.str:
        """
        可用区 ID。
        """
        return pulumi.get(self, "zone_ids")


class AwaitableGetInstanceResult(GetInstanceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstanceResult(
            charge_detail=self.charge_detail,
            created_time=self.created_time,
            db_engine_version=self.db_engine_version,
            db_minor_version=self.db_minor_version,
            db_revision_version=self.db_revision_version,
            deletion_protection=self.deletion_protection,
            endpoints=self.endpoints,
            id=self.id,
            instance_id=self.instance_id,
            instance_name=self.instance_name,
            instance_status=self.instance_status,
            lower_case_table_names=self.lower_case_table_names,
            maintenance_window=self.maintenance_window,
            node_number=self.node_number,
            node_spec=self.node_spec,
            nodes=self.nodes,
            number=self.number,
            port=self.port,
            pre_paid_storage_in_gb=self.pre_paid_storage_in_gb,
            project_name=self.project_name,
            spec_family=self.spec_family,
            storage_charge_type=self.storage_charge_type,
            storage_used_gi_b=self.storage_used_gi_b,
            subnet_id=self.subnet_id,
            super_account_name=self.super_account_name,
            super_account_password=self.super_account_password,
            tags=self.tags,
            template_id=self.template_id,
            time_zone=self.time_zone,
            vpc_id=self.vpc_id,
            zone_ids=self.zone_ids)


def get_instance(id: Optional[builtins.str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInstanceResult:
    """
    Data Source schema for Byteplus::VEDBM::Instance


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:vedbm/getInstance:getInstance', __args__, opts=opts, typ=GetInstanceResult).value

    return AwaitableGetInstanceResult(
        charge_detail=pulumi.get(__ret__, 'charge_detail'),
        created_time=pulumi.get(__ret__, 'created_time'),
        db_engine_version=pulumi.get(__ret__, 'db_engine_version'),
        db_minor_version=pulumi.get(__ret__, 'db_minor_version'),
        db_revision_version=pulumi.get(__ret__, 'db_revision_version'),
        deletion_protection=pulumi.get(__ret__, 'deletion_protection'),
        endpoints=pulumi.get(__ret__, 'endpoints'),
        id=pulumi.get(__ret__, 'id'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        instance_name=pulumi.get(__ret__, 'instance_name'),
        instance_status=pulumi.get(__ret__, 'instance_status'),
        lower_case_table_names=pulumi.get(__ret__, 'lower_case_table_names'),
        maintenance_window=pulumi.get(__ret__, 'maintenance_window'),
        node_number=pulumi.get(__ret__, 'node_number'),
        node_spec=pulumi.get(__ret__, 'node_spec'),
        nodes=pulumi.get(__ret__, 'nodes'),
        number=pulumi.get(__ret__, 'number'),
        port=pulumi.get(__ret__, 'port'),
        pre_paid_storage_in_gb=pulumi.get(__ret__, 'pre_paid_storage_in_gb'),
        project_name=pulumi.get(__ret__, 'project_name'),
        spec_family=pulumi.get(__ret__, 'spec_family'),
        storage_charge_type=pulumi.get(__ret__, 'storage_charge_type'),
        storage_used_gi_b=pulumi.get(__ret__, 'storage_used_gi_b'),
        subnet_id=pulumi.get(__ret__, 'subnet_id'),
        super_account_name=pulumi.get(__ret__, 'super_account_name'),
        super_account_password=pulumi.get(__ret__, 'super_account_password'),
        tags=pulumi.get(__ret__, 'tags'),
        template_id=pulumi.get(__ret__, 'template_id'),
        time_zone=pulumi.get(__ret__, 'time_zone'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'),
        zone_ids=pulumi.get(__ret__, 'zone_ids'))
def get_instance_output(id: Optional[pulumi.Input[builtins.str]] = None,
                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetInstanceResult]:
    """
    Data Source schema for Byteplus::VEDBM::Instance


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:vedbm/getInstance:getInstance', __args__, opts=opts, typ=GetInstanceResult)
    return __ret__.apply(lambda __response__: GetInstanceResult(
        charge_detail=pulumi.get(__response__, 'charge_detail'),
        created_time=pulumi.get(__response__, 'created_time'),
        db_engine_version=pulumi.get(__response__, 'db_engine_version'),
        db_minor_version=pulumi.get(__response__, 'db_minor_version'),
        db_revision_version=pulumi.get(__response__, 'db_revision_version'),
        deletion_protection=pulumi.get(__response__, 'deletion_protection'),
        endpoints=pulumi.get(__response__, 'endpoints'),
        id=pulumi.get(__response__, 'id'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        instance_name=pulumi.get(__response__, 'instance_name'),
        instance_status=pulumi.get(__response__, 'instance_status'),
        lower_case_table_names=pulumi.get(__response__, 'lower_case_table_names'),
        maintenance_window=pulumi.get(__response__, 'maintenance_window'),
        node_number=pulumi.get(__response__, 'node_number'),
        node_spec=pulumi.get(__response__, 'node_spec'),
        nodes=pulumi.get(__response__, 'nodes'),
        number=pulumi.get(__response__, 'number'),
        port=pulumi.get(__response__, 'port'),
        pre_paid_storage_in_gb=pulumi.get(__response__, 'pre_paid_storage_in_gb'),
        project_name=pulumi.get(__response__, 'project_name'),
        spec_family=pulumi.get(__response__, 'spec_family'),
        storage_charge_type=pulumi.get(__response__, 'storage_charge_type'),
        storage_used_gi_b=pulumi.get(__response__, 'storage_used_gi_b'),
        subnet_id=pulumi.get(__response__, 'subnet_id'),
        super_account_name=pulumi.get(__response__, 'super_account_name'),
        super_account_password=pulumi.get(__response__, 'super_account_password'),
        tags=pulumi.get(__response__, 'tags'),
        template_id=pulumi.get(__response__, 'template_id'),
        time_zone=pulumi.get(__response__, 'time_zone'),
        vpc_id=pulumi.get(__response__, 'vpc_id'),
        zone_ids=pulumi.get(__response__, 'zone_ids')))
