# 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__, affinity_group_size=None, auto_renew=None, auto_renew_period=None, cpu_max_frequency=None, cpu_memory=None, created_at=None, credit_specification=None, deletion_protection=None, deployment_set_group_number=None, deployment_set_id=None, description=None, eip_address=None, expired_at=None, hostname=None, hpc_cluster_id=None, id=None, image=None, instance_charge_type=None, instance_id=None, instance_name=None, instance_type=None, key_pair=None, operation_system=None, password=None, period=None, period_unit=None, placement=None, primary_network_interface=None, project_name=None, secondary_network_interfaces=None, spot_price_limit=None, spot_strategy=None, status=None, stopped_mode=None, system_volume=None, tags=None, updated_at=None, user_data=None, vpc_id=None, zone_id=None):
        if affinity_group_size and not isinstance(affinity_group_size, int):
            raise TypeError("Expected argument 'affinity_group_size' to be a int")
        pulumi.set(__self__, "affinity_group_size", affinity_group_size)
        if auto_renew and not isinstance(auto_renew, bool):
            raise TypeError("Expected argument 'auto_renew' to be a bool")
        pulumi.set(__self__, "auto_renew", auto_renew)
        if auto_renew_period and not isinstance(auto_renew_period, int):
            raise TypeError("Expected argument 'auto_renew_period' to be a int")
        pulumi.set(__self__, "auto_renew_period", auto_renew_period)
        if cpu_max_frequency and not isinstance(cpu_max_frequency, float):
            raise TypeError("Expected argument 'cpu_max_frequency' to be a float")
        pulumi.set(__self__, "cpu_max_frequency", cpu_max_frequency)
        if cpu_memory and not isinstance(cpu_memory, dict):
            raise TypeError("Expected argument 'cpu_memory' to be a dict")
        pulumi.set(__self__, "cpu_memory", cpu_memory)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if credit_specification and not isinstance(credit_specification, str):
            raise TypeError("Expected argument 'credit_specification' to be a str")
        pulumi.set(__self__, "credit_specification", credit_specification)
        if deletion_protection and not isinstance(deletion_protection, bool):
            raise TypeError("Expected argument 'deletion_protection' to be a bool")
        pulumi.set(__self__, "deletion_protection", deletion_protection)
        if deployment_set_group_number and not isinstance(deployment_set_group_number, int):
            raise TypeError("Expected argument 'deployment_set_group_number' to be a int")
        pulumi.set(__self__, "deployment_set_group_number", deployment_set_group_number)
        if deployment_set_id and not isinstance(deployment_set_id, str):
            raise TypeError("Expected argument 'deployment_set_id' to be a str")
        pulumi.set(__self__, "deployment_set_id", deployment_set_id)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if eip_address and not isinstance(eip_address, dict):
            raise TypeError("Expected argument 'eip_address' to be a dict")
        pulumi.set(__self__, "eip_address", eip_address)
        if expired_at and not isinstance(expired_at, str):
            raise TypeError("Expected argument 'expired_at' to be a str")
        pulumi.set(__self__, "expired_at", expired_at)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if hpc_cluster_id and not isinstance(hpc_cluster_id, str):
            raise TypeError("Expected argument 'hpc_cluster_id' to be a str")
        pulumi.set(__self__, "hpc_cluster_id", hpc_cluster_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if image and not isinstance(image, dict):
            raise TypeError("Expected argument 'image' to be a dict")
        pulumi.set(__self__, "image", image)
        if instance_charge_type and not isinstance(instance_charge_type, str):
            raise TypeError("Expected argument 'instance_charge_type' to be a str")
        pulumi.set(__self__, "instance_charge_type", instance_charge_type)
        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_type and not isinstance(instance_type, str):
            raise TypeError("Expected argument 'instance_type' to be a str")
        pulumi.set(__self__, "instance_type", instance_type)
        if key_pair and not isinstance(key_pair, dict):
            raise TypeError("Expected argument 'key_pair' to be a dict")
        pulumi.set(__self__, "key_pair", key_pair)
        if operation_system and not isinstance(operation_system, dict):
            raise TypeError("Expected argument 'operation_system' to be a dict")
        pulumi.set(__self__, "operation_system", operation_system)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if period and not isinstance(period, int):
            raise TypeError("Expected argument 'period' to be a int")
        pulumi.set(__self__, "period", period)
        if period_unit and not isinstance(period_unit, str):
            raise TypeError("Expected argument 'period_unit' to be a str")
        pulumi.set(__self__, "period_unit", period_unit)
        if placement and not isinstance(placement, dict):
            raise TypeError("Expected argument 'placement' to be a dict")
        pulumi.set(__self__, "placement", placement)
        if primary_network_interface and not isinstance(primary_network_interface, dict):
            raise TypeError("Expected argument 'primary_network_interface' to be a dict")
        pulumi.set(__self__, "primary_network_interface", primary_network_interface)
        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 secondary_network_interfaces and not isinstance(secondary_network_interfaces, list):
            raise TypeError("Expected argument 'secondary_network_interfaces' to be a list")
        pulumi.set(__self__, "secondary_network_interfaces", secondary_network_interfaces)
        if spot_price_limit and not isinstance(spot_price_limit, float):
            raise TypeError("Expected argument 'spot_price_limit' to be a float")
        pulumi.set(__self__, "spot_price_limit", spot_price_limit)
        if spot_strategy and not isinstance(spot_strategy, str):
            raise TypeError("Expected argument 'spot_strategy' to be a str")
        pulumi.set(__self__, "spot_strategy", spot_strategy)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if stopped_mode and not isinstance(stopped_mode, str):
            raise TypeError("Expected argument 'stopped_mode' to be a str")
        pulumi.set(__self__, "stopped_mode", stopped_mode)
        if system_volume and not isinstance(system_volume, dict):
            raise TypeError("Expected argument 'system_volume' to be a dict")
        pulumi.set(__self__, "system_volume", system_volume)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)
        if user_data and not isinstance(user_data, str):
            raise TypeError("Expected argument 'user_data' to be a str")
        pulumi.set(__self__, "user_data", user_data)
        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_id and not isinstance(zone_id, str):
            raise TypeError("Expected argument 'zone_id' to be a str")
        pulumi.set(__self__, "zone_id", zone_id)

    @property
    @pulumi.getter(name="affinityGroupSize")
    def affinity_group_size(self) -> builtins.int:
        return pulumi.get(self, "affinity_group_size")

    @property
    @pulumi.getter(name="autoRenew")
    def auto_renew(self) -> builtins.bool:
        return pulumi.get(self, "auto_renew")

    @property
    @pulumi.getter(name="autoRenewPeriod")
    def auto_renew_period(self) -> builtins.int:
        return pulumi.get(self, "auto_renew_period")

    @property
    @pulumi.getter(name="cpuMaxFrequency")
    def cpu_max_frequency(self) -> builtins.float:
        return pulumi.get(self, "cpu_max_frequency")

    @property
    @pulumi.getter(name="cpuMemory")
    def cpu_memory(self) -> 'outputs.GetInstanceCpuMemoryResult':
        return pulumi.get(self, "cpu_memory")

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> builtins.str:
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="creditSpecification")
    def credit_specification(self) -> builtins.str:
        return pulumi.get(self, "credit_specification")

    @property
    @pulumi.getter(name="deletionProtection")
    def deletion_protection(self) -> builtins.bool:
        return pulumi.get(self, "deletion_protection")

    @property
    @pulumi.getter(name="deploymentSetGroupNumber")
    def deployment_set_group_number(self) -> builtins.int:
        return pulumi.get(self, "deployment_set_group_number")

    @property
    @pulumi.getter(name="deploymentSetId")
    def deployment_set_id(self) -> builtins.str:
        return pulumi.get(self, "deployment_set_id")

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

    @property
    @pulumi.getter(name="eipAddress")
    def eip_address(self) -> 'outputs.GetInstanceEipAddressResult':
        return pulumi.get(self, "eip_address")

    @property
    @pulumi.getter(name="expiredAt")
    def expired_at(self) -> builtins.str:
        return pulumi.get(self, "expired_at")

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

    @property
    @pulumi.getter(name="hpcClusterId")
    def hpc_cluster_id(self) -> builtins.str:
        return pulumi.get(self, "hpc_cluster_id")

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

    @property
    @pulumi.getter
    def image(self) -> 'outputs.GetInstanceImageResult':
        return pulumi.get(self, "image")

    @property
    @pulumi.getter(name="instanceChargeType")
    def instance_charge_type(self) -> builtins.str:
        return pulumi.get(self, "instance_charge_type")

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

    @property
    @pulumi.getter(name="instanceName")
    def instance_name(self) -> builtins.str:
        return pulumi.get(self, "instance_name")

    @property
    @pulumi.getter(name="instanceType")
    def instance_type(self) -> builtins.str:
        return pulumi.get(self, "instance_type")

    @property
    @pulumi.getter(name="keyPair")
    def key_pair(self) -> 'outputs.GetInstanceKeyPairResult':
        return pulumi.get(self, "key_pair")

    @property
    @pulumi.getter(name="operationSystem")
    def operation_system(self) -> 'outputs.GetInstanceOperationSystemResult':
        return pulumi.get(self, "operation_system")

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

    @property
    @pulumi.getter
    def period(self) -> builtins.int:
        return pulumi.get(self, "period")

    @property
    @pulumi.getter(name="periodUnit")
    def period_unit(self) -> builtins.str:
        return pulumi.get(self, "period_unit")

    @property
    @pulumi.getter
    def placement(self) -> 'outputs.GetInstancePlacementResult':
        return pulumi.get(self, "placement")

    @property
    @pulumi.getter(name="primaryNetworkInterface")
    def primary_network_interface(self) -> 'outputs.GetInstancePrimaryNetworkInterfaceResult':
        return pulumi.get(self, "primary_network_interface")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="secondaryNetworkInterfaces")
    def secondary_network_interfaces(self) -> Sequence['outputs.GetInstanceSecondaryNetworkInterfaceResult']:
        return pulumi.get(self, "secondary_network_interfaces")

    @property
    @pulumi.getter(name="spotPriceLimit")
    def spot_price_limit(self) -> builtins.float:
        return pulumi.get(self, "spot_price_limit")

    @property
    @pulumi.getter(name="spotStrategy")
    def spot_strategy(self) -> builtins.str:
        return pulumi.get(self, "spot_strategy")

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

    @property
    @pulumi.getter(name="stoppedMode")
    def stopped_mode(self) -> builtins.str:
        return pulumi.get(self, "stopped_mode")

    @property
    @pulumi.getter(name="systemVolume")
    def system_volume(self) -> 'outputs.GetInstanceSystemVolumeResult':
        return pulumi.get(self, "system_volume")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetInstanceTagResult']:
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> builtins.str:
        return pulumi.get(self, "updated_at")

    @property
    @pulumi.getter(name="userData")
    def user_data(self) -> builtins.str:
        return pulumi.get(self, "user_data")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        return pulumi.get(self, "vpc_id")

    @property
    @pulumi.getter(name="zoneId")
    def zone_id(self) -> builtins.str:
        return pulumi.get(self, "zone_id")


class AwaitableGetInstanceResult(GetInstanceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstanceResult(
            affinity_group_size=self.affinity_group_size,
            auto_renew=self.auto_renew,
            auto_renew_period=self.auto_renew_period,
            cpu_max_frequency=self.cpu_max_frequency,
            cpu_memory=self.cpu_memory,
            created_at=self.created_at,
            credit_specification=self.credit_specification,
            deletion_protection=self.deletion_protection,
            deployment_set_group_number=self.deployment_set_group_number,
            deployment_set_id=self.deployment_set_id,
            description=self.description,
            eip_address=self.eip_address,
            expired_at=self.expired_at,
            hostname=self.hostname,
            hpc_cluster_id=self.hpc_cluster_id,
            id=self.id,
            image=self.image,
            instance_charge_type=self.instance_charge_type,
            instance_id=self.instance_id,
            instance_name=self.instance_name,
            instance_type=self.instance_type,
            key_pair=self.key_pair,
            operation_system=self.operation_system,
            password=self.password,
            period=self.period,
            period_unit=self.period_unit,
            placement=self.placement,
            primary_network_interface=self.primary_network_interface,
            project_name=self.project_name,
            secondary_network_interfaces=self.secondary_network_interfaces,
            spot_price_limit=self.spot_price_limit,
            spot_strategy=self.spot_strategy,
            status=self.status,
            stopped_mode=self.stopped_mode,
            system_volume=self.system_volume,
            tags=self.tags,
            updated_at=self.updated_at,
            user_data=self.user_data,
            vpc_id=self.vpc_id,
            zone_id=self.zone_id)


def get_instance(id: Optional[builtins.str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInstanceResult:
    """
    Data Source schema for Byteplus::ECS::Instance
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:ecs/getInstance:getInstance', __args__, opts=opts, typ=GetInstanceResult).value

    return AwaitableGetInstanceResult(
        affinity_group_size=pulumi.get(__ret__, 'affinity_group_size'),
        auto_renew=pulumi.get(__ret__, 'auto_renew'),
        auto_renew_period=pulumi.get(__ret__, 'auto_renew_period'),
        cpu_max_frequency=pulumi.get(__ret__, 'cpu_max_frequency'),
        cpu_memory=pulumi.get(__ret__, 'cpu_memory'),
        created_at=pulumi.get(__ret__, 'created_at'),
        credit_specification=pulumi.get(__ret__, 'credit_specification'),
        deletion_protection=pulumi.get(__ret__, 'deletion_protection'),
        deployment_set_group_number=pulumi.get(__ret__, 'deployment_set_group_number'),
        deployment_set_id=pulumi.get(__ret__, 'deployment_set_id'),
        description=pulumi.get(__ret__, 'description'),
        eip_address=pulumi.get(__ret__, 'eip_address'),
        expired_at=pulumi.get(__ret__, 'expired_at'),
        hostname=pulumi.get(__ret__, 'hostname'),
        hpc_cluster_id=pulumi.get(__ret__, 'hpc_cluster_id'),
        id=pulumi.get(__ret__, 'id'),
        image=pulumi.get(__ret__, 'image'),
        instance_charge_type=pulumi.get(__ret__, 'instance_charge_type'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        instance_name=pulumi.get(__ret__, 'instance_name'),
        instance_type=pulumi.get(__ret__, 'instance_type'),
        key_pair=pulumi.get(__ret__, 'key_pair'),
        operation_system=pulumi.get(__ret__, 'operation_system'),
        password=pulumi.get(__ret__, 'password'),
        period=pulumi.get(__ret__, 'period'),
        period_unit=pulumi.get(__ret__, 'period_unit'),
        placement=pulumi.get(__ret__, 'placement'),
        primary_network_interface=pulumi.get(__ret__, 'primary_network_interface'),
        project_name=pulumi.get(__ret__, 'project_name'),
        secondary_network_interfaces=pulumi.get(__ret__, 'secondary_network_interfaces'),
        spot_price_limit=pulumi.get(__ret__, 'spot_price_limit'),
        spot_strategy=pulumi.get(__ret__, 'spot_strategy'),
        status=pulumi.get(__ret__, 'status'),
        stopped_mode=pulumi.get(__ret__, 'stopped_mode'),
        system_volume=pulumi.get(__ret__, 'system_volume'),
        tags=pulumi.get(__ret__, 'tags'),
        updated_at=pulumi.get(__ret__, 'updated_at'),
        user_data=pulumi.get(__ret__, 'user_data'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'),
        zone_id=pulumi.get(__ret__, 'zone_id'))
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::ECS::Instance
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:ecs/getInstance:getInstance', __args__, opts=opts, typ=GetInstanceResult)
    return __ret__.apply(lambda __response__: GetInstanceResult(
        affinity_group_size=pulumi.get(__response__, 'affinity_group_size'),
        auto_renew=pulumi.get(__response__, 'auto_renew'),
        auto_renew_period=pulumi.get(__response__, 'auto_renew_period'),
        cpu_max_frequency=pulumi.get(__response__, 'cpu_max_frequency'),
        cpu_memory=pulumi.get(__response__, 'cpu_memory'),
        created_at=pulumi.get(__response__, 'created_at'),
        credit_specification=pulumi.get(__response__, 'credit_specification'),
        deletion_protection=pulumi.get(__response__, 'deletion_protection'),
        deployment_set_group_number=pulumi.get(__response__, 'deployment_set_group_number'),
        deployment_set_id=pulumi.get(__response__, 'deployment_set_id'),
        description=pulumi.get(__response__, 'description'),
        eip_address=pulumi.get(__response__, 'eip_address'),
        expired_at=pulumi.get(__response__, 'expired_at'),
        hostname=pulumi.get(__response__, 'hostname'),
        hpc_cluster_id=pulumi.get(__response__, 'hpc_cluster_id'),
        id=pulumi.get(__response__, 'id'),
        image=pulumi.get(__response__, 'image'),
        instance_charge_type=pulumi.get(__response__, 'instance_charge_type'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        instance_name=pulumi.get(__response__, 'instance_name'),
        instance_type=pulumi.get(__response__, 'instance_type'),
        key_pair=pulumi.get(__response__, 'key_pair'),
        operation_system=pulumi.get(__response__, 'operation_system'),
        password=pulumi.get(__response__, 'password'),
        period=pulumi.get(__response__, 'period'),
        period_unit=pulumi.get(__response__, 'period_unit'),
        placement=pulumi.get(__response__, 'placement'),
        primary_network_interface=pulumi.get(__response__, 'primary_network_interface'),
        project_name=pulumi.get(__response__, 'project_name'),
        secondary_network_interfaces=pulumi.get(__response__, 'secondary_network_interfaces'),
        spot_price_limit=pulumi.get(__response__, 'spot_price_limit'),
        spot_strategy=pulumi.get(__response__, 'spot_strategy'),
        status=pulumi.get(__response__, 'status'),
        stopped_mode=pulumi.get(__response__, 'stopped_mode'),
        system_volume=pulumi.get(__response__, 'system_volume'),
        tags=pulumi.get(__response__, 'tags'),
        updated_at=pulumi.get(__response__, 'updated_at'),
        user_data=pulumi.get(__response__, 'user_data'),
        vpc_id=pulumi.get(__response__, 'vpc_id'),
        zone_id=pulumi.get(__response__, 'zone_id')))
