# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetInstanceTypesResult:
    """
    A collection of values returned by getInstanceTypes.
    """
    def __init__(__self__, availability_zone=None, cpu_core_count=None, eni_amount=None, gpu_amount=None, gpu_spec=None, ids=None, instance_charge_type=None, instance_type_family=None, instance_types=None, is_outdated=None, kubernetes_node_role=None, memory_size=None, network_type=None, output_file=None, sorted_by=None, spot_strategy=None, id=None):
        if availability_zone and not isinstance(availability_zone, str):
            raise TypeError("Expected argument 'availability_zone' to be a str")
        __self__.availability_zone = availability_zone
        if cpu_core_count and not isinstance(cpu_core_count, float):
            raise TypeError("Expected argument 'cpu_core_count' to be a float")
        __self__.cpu_core_count = cpu_core_count
        """
        Number of CPU cores.
        """
        if eni_amount and not isinstance(eni_amount, float):
            raise TypeError("Expected argument 'eni_amount' to be a float")
        __self__.eni_amount = eni_amount
        """
        The maximum number of network interfaces that an instance type can be attached to.
        """
        if gpu_amount and not isinstance(gpu_amount, float):
            raise TypeError("Expected argument 'gpu_amount' to be a float")
        __self__.gpu_amount = gpu_amount
        if gpu_spec and not isinstance(gpu_spec, str):
            raise TypeError("Expected argument 'gpu_spec' to be a str")
        __self__.gpu_spec = gpu_spec
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        __self__.ids = ids
        """
        A list of instance type IDs.
        """
        if instance_charge_type and not isinstance(instance_charge_type, str):
            raise TypeError("Expected argument 'instance_charge_type' to be a str")
        __self__.instance_charge_type = instance_charge_type
        if instance_type_family and not isinstance(instance_type_family, str):
            raise TypeError("Expected argument 'instance_type_family' to be a str")
        __self__.instance_type_family = instance_type_family
        if instance_types and not isinstance(instance_types, list):
            raise TypeError("Expected argument 'instance_types' to be a list")
        __self__.instance_types = instance_types
        """
        A list of image types. Each element contains the following attributes:
        """
        if is_outdated and not isinstance(is_outdated, bool):
            raise TypeError("Expected argument 'is_outdated' to be a bool")
        __self__.is_outdated = is_outdated
        if kubernetes_node_role and not isinstance(kubernetes_node_role, str):
            raise TypeError("Expected argument 'kubernetes_node_role' to be a str")
        __self__.kubernetes_node_role = kubernetes_node_role
        if memory_size and not isinstance(memory_size, float):
            raise TypeError("Expected argument 'memory_size' to be a float")
        __self__.memory_size = memory_size
        """
        Size of memory, measured in GB.
        """
        if network_type and not isinstance(network_type, str):
            raise TypeError("Expected argument 'network_type' to be a str")
        __self__.network_type = network_type
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        __self__.output_file = output_file
        if sorted_by and not isinstance(sorted_by, str):
            raise TypeError("Expected argument 'sorted_by' to be a str")
        __self__.sorted_by = sorted_by
        if spot_strategy and not isinstance(spot_strategy, str):
            raise TypeError("Expected argument 'spot_strategy' to be a str")
        __self__.spot_strategy = spot_strategy
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
class AwaitableGetInstanceTypesResult(GetInstanceTypesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstanceTypesResult(
            availability_zone=self.availability_zone,
            cpu_core_count=self.cpu_core_count,
            eni_amount=self.eni_amount,
            gpu_amount=self.gpu_amount,
            gpu_spec=self.gpu_spec,
            ids=self.ids,
            instance_charge_type=self.instance_charge_type,
            instance_type_family=self.instance_type_family,
            instance_types=self.instance_types,
            is_outdated=self.is_outdated,
            kubernetes_node_role=self.kubernetes_node_role,
            memory_size=self.memory_size,
            network_type=self.network_type,
            output_file=self.output_file,
            sorted_by=self.sorted_by,
            spot_strategy=self.spot_strategy,
            id=self.id)

def get_instance_types(availability_zone=None,cpu_core_count=None,eni_amount=None,gpu_amount=None,gpu_spec=None,instance_charge_type=None,instance_type_family=None,is_outdated=None,kubernetes_node_role=None,memory_size=None,network_type=None,output_file=None,sorted_by=None,spot_strategy=None,opts=None):
    """
    This data source provides the ECS instance types of Alibaba Cloud.
    
    > **NOTE:** By default, only the upgraded instance types are returned. If you want to get outdated instance types, you must set `is_outdated` to true.
    
    > **NOTE:** If one instance type is sold out, it will not be exported.
    
    :param str availability_zone: The zone where instance types are supported.
    :param float cpu_core_count: Filter the results to a specific number of cpu cores.
    :param float eni_amount: Filter the result whose network interface number is no more than `eni_amount`.
    :param float gpu_amount: The GPU amount of an instance type.
    :param str gpu_spec: The GPU spec of an instance type.
    :param str instance_charge_type: Filter the results by charge type. Valid values: `PrePaid` and `PostPaid`. Default to `PostPaid`.
    :param str instance_type_family: Filter the results based on their family name. For example: 'ecs.n4'.
    :param bool is_outdated: If true, outdated instance types are included in the results. Default to false.
    :param float memory_size: Filter the results to a specific memory size in GB.
    :param str network_type: Filter the results by network type. Valid values: `Classic` and `Vpc`.
    :param str spot_strategy: Filter the results by ECS spot type. Valid values: `NoSpot`, `SpotWithPriceLimit` and `SpotAsPriceGo`. Default to `NoSpot`.

    > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/d/instance_types.html.markdown.
    """
    __args__ = dict()

    __args__['availabilityZone'] = availability_zone
    __args__['cpuCoreCount'] = cpu_core_count
    __args__['eniAmount'] = eni_amount
    __args__['gpuAmount'] = gpu_amount
    __args__['gpuSpec'] = gpu_spec
    __args__['instanceChargeType'] = instance_charge_type
    __args__['instanceTypeFamily'] = instance_type_family
    __args__['isOutdated'] = is_outdated
    __args__['kubernetesNodeRole'] = kubernetes_node_role
    __args__['memorySize'] = memory_size
    __args__['networkType'] = network_type
    __args__['outputFile'] = output_file
    __args__['sortedBy'] = sorted_by
    __args__['spotStrategy'] = spot_strategy
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:ecs/getInstanceTypes:getInstanceTypes', __args__, opts=opts).value

    return AwaitableGetInstanceTypesResult(
        availability_zone=__ret__.get('availabilityZone'),
        cpu_core_count=__ret__.get('cpuCoreCount'),
        eni_amount=__ret__.get('eniAmount'),
        gpu_amount=__ret__.get('gpuAmount'),
        gpu_spec=__ret__.get('gpuSpec'),
        ids=__ret__.get('ids'),
        instance_charge_type=__ret__.get('instanceChargeType'),
        instance_type_family=__ret__.get('instanceTypeFamily'),
        instance_types=__ret__.get('instanceTypes'),
        is_outdated=__ret__.get('isOutdated'),
        kubernetes_node_role=__ret__.get('kubernetesNodeRole'),
        memory_size=__ret__.get('memorySize'),
        network_type=__ret__.get('networkType'),
        output_file=__ret__.get('outputFile'),
        sorted_by=__ret__.get('sortedBy'),
        spot_strategy=__ret__.get('spotStrategy'),
        id=__ret__.get('id'))
