Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getInstanceTypes

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.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var typesDs = Output.Create(AliCloud.Ecs.GetInstanceTypes.InvokeAsync(new AliCloud.Ecs.GetInstanceTypesArgs
        {
            CpuCoreCount = 1,
            MemorySize = 2,
        }));
        var instance = new AliCloud.Ecs.Instance("instance", new AliCloud.Ecs.InstanceArgs
        {
            InstanceType = typesDs.Apply(typesDs => typesDs.InstanceTypes?[0]?.Id),
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		typesDs, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
			CpuCoreCount: pulumi.IntRef(1),
			MemorySize:   pulumi.Float64Ref(2),
		}, nil)
		if err != nil {
			return err
		}
		_, err = ecs.NewInstance(ctx, "instance", &ecs.InstanceArgs{
			InstanceType: pulumi.String(typesDs.InstanceTypes[0].Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

types_ds = alicloud.ecs.get_instance_types(cpu_core_count=1,
    memory_size=2)
instance = alicloud.ecs.Instance("instance", instance_type=types_ds.instance_types[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Declare the data source
const typesDs = pulumi.output(alicloud.ecs.getInstanceTypes({
    cpuCoreCount: 1,
    memorySize: 2,
}));
const instance = new alicloud.ecs.Instance("instance", {
    instanceType: typesDs.instanceTypes[0].id,
});

Coming soon!

Using getInstanceTypes

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getInstanceTypes(args: GetInstanceTypesArgs, opts?: InvokeOptions): Promise<GetInstanceTypesResult>
function getInstanceTypesOutput(args: GetInstanceTypesOutputArgs, opts?: InvokeOptions): Output<GetInstanceTypesResult>
def get_instance_types(availability_zone: Optional[str] = None,
                       cpu_core_count: Optional[int] = None,
                       eni_amount: Optional[int] = None,
                       gpu_amount: Optional[int] = None,
                       gpu_spec: Optional[str] = None,
                       instance_charge_type: Optional[str] = None,
                       instance_type_family: Optional[str] = None,
                       is_outdated: Optional[bool] = None,
                       kubernetes_node_role: Optional[str] = None,
                       memory_size: Optional[float] = None,
                       network_type: Optional[str] = None,
                       output_file: Optional[str] = None,
                       sorted_by: Optional[str] = None,
                       spot_strategy: Optional[str] = None,
                       system_disk_category: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetInstanceTypesResult
def get_instance_types_output(availability_zone: Optional[pulumi.Input[str]] = None,
                       cpu_core_count: Optional[pulumi.Input[int]] = None,
                       eni_amount: Optional[pulumi.Input[int]] = None,
                       gpu_amount: Optional[pulumi.Input[int]] = None,
                       gpu_spec: Optional[pulumi.Input[str]] = None,
                       instance_charge_type: Optional[pulumi.Input[str]] = None,
                       instance_type_family: Optional[pulumi.Input[str]] = None,
                       is_outdated: Optional[pulumi.Input[bool]] = None,
                       kubernetes_node_role: Optional[pulumi.Input[str]] = None,
                       memory_size: Optional[pulumi.Input[float]] = None,
                       network_type: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       sorted_by: Optional[pulumi.Input[str]] = None,
                       spot_strategy: Optional[pulumi.Input[str]] = None,
                       system_disk_category: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetInstanceTypesResult]
func GetInstanceTypes(ctx *Context, args *GetInstanceTypesArgs, opts ...InvokeOption) (*GetInstanceTypesResult, error)
func GetInstanceTypesOutput(ctx *Context, args *GetInstanceTypesOutputArgs, opts ...InvokeOption) GetInstanceTypesResultOutput

> Note: This function is named GetInstanceTypes in the Go SDK.

public static class GetInstanceTypes 
{
    public static Task<GetInstanceTypesResult> InvokeAsync(GetInstanceTypesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceTypesResult> Invoke(GetInstanceTypesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceTypesResult> getInstanceTypes(GetInstanceTypesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:ecs/getInstanceTypes:getInstanceTypes
  Arguments:
    # Arguments dictionary

The following arguments are supported:

AvailabilityZone string

The zone where instance types are supported.

CpuCoreCount int

Filter the results to a specific number of cpu cores.

EniAmount int

Filter the result whose network interface number is no more than eni_amount.

GpuAmount int

The GPU amount of an instance type.

GpuSpec string

The GPU spec of an instance type.

InstanceChargeType string

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

InstanceTypeFamily string

Filter the results based on their family name. For example: 'ecs.n4'.

IsOutdated bool

If true, outdated instance types are included in the results. Default to false.

KubernetesNodeRole string
MemorySize double

Filter the results to a specific memory size in GB.

NetworkType string

Filter the results by network type. Valid values: Classic and Vpc.

OutputFile string
SortedBy string
SpotStrategy string

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

SystemDiskCategory string

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

AvailabilityZone string

The zone where instance types are supported.

CpuCoreCount int

Filter the results to a specific number of cpu cores.

EniAmount int

Filter the result whose network interface number is no more than eni_amount.

GpuAmount int

The GPU amount of an instance type.

GpuSpec string

The GPU spec of an instance type.

InstanceChargeType string

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

InstanceTypeFamily string

Filter the results based on their family name. For example: 'ecs.n4'.

IsOutdated bool

If true, outdated instance types are included in the results. Default to false.

KubernetesNodeRole string
MemorySize float64

Filter the results to a specific memory size in GB.

NetworkType string

Filter the results by network type. Valid values: Classic and Vpc.

OutputFile string
SortedBy string
SpotStrategy string

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

SystemDiskCategory string

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

availabilityZone String

The zone where instance types are supported.

cpuCoreCount Integer

Filter the results to a specific number of cpu cores.

eniAmount Integer

Filter the result whose network interface number is no more than eni_amount.

gpuAmount Integer

The GPU amount of an instance type.

gpuSpec String

The GPU spec of an instance type.

instanceChargeType String

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

instanceTypeFamily String

Filter the results based on their family name. For example: 'ecs.n4'.

isOutdated Boolean

If true, outdated instance types are included in the results. Default to false.

kubernetesNodeRole String
memorySize Double

Filter the results to a specific memory size in GB.

networkType String

Filter the results by network type. Valid values: Classic and Vpc.

outputFile String
sortedBy String
spotStrategy String

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

systemDiskCategory String

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

availabilityZone string

The zone where instance types are supported.

cpuCoreCount number

Filter the results to a specific number of cpu cores.

eniAmount number

Filter the result whose network interface number is no more than eni_amount.

gpuAmount number

The GPU amount of an instance type.

gpuSpec string

The GPU spec of an instance type.

instanceChargeType string

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

instanceTypeFamily string

Filter the results based on their family name. For example: 'ecs.n4'.

isOutdated boolean

If true, outdated instance types are included in the results. Default to false.

kubernetesNodeRole string
memorySize number

Filter the results to a specific memory size in GB.

networkType string

Filter the results by network type. Valid values: Classic and Vpc.

outputFile string
sortedBy string
spotStrategy string

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

systemDiskCategory string

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

availability_zone str

The zone where instance types are supported.

cpu_core_count int

Filter the results to a specific number of cpu cores.

eni_amount int

Filter the result whose network interface number is no more than eni_amount.

gpu_amount int

The GPU amount of an instance type.

gpu_spec str

The GPU spec of an instance type.

instance_charge_type str

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

instance_type_family str

Filter the results based on their family name. For example: 'ecs.n4'.

is_outdated bool

If true, outdated instance types are included in the results. Default to false.

kubernetes_node_role str
memory_size float

Filter the results to a specific memory size in GB.

network_type str

Filter the results by network type. Valid values: Classic and Vpc.

output_file str
sorted_by str
spot_strategy str

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

system_disk_category str

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

availabilityZone String

The zone where instance types are supported.

cpuCoreCount Number

Filter the results to a specific number of cpu cores.

eniAmount Number

Filter the result whose network interface number is no more than eni_amount.

gpuAmount Number

The GPU amount of an instance type.

gpuSpec String

The GPU spec of an instance type.

instanceChargeType String

Filter the results by charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.

instanceTypeFamily String

Filter the results based on their family name. For example: 'ecs.n4'.

isOutdated Boolean

If true, outdated instance types are included in the results. Default to false.

kubernetesNodeRole String
memorySize Number

Filter the results to a specific memory size in GB.

networkType String

Filter the results by network type. Valid values: Classic and Vpc.

outputFile String
sortedBy String
spotStrategy String

Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.

systemDiskCategory String

Filter the results by system disk category. Valid values: cloud, ephemeral_ssd, cloud_essd, cloud_efficiency, cloud_ssd. NOTE: Its default value cloud_efficiency has been removed from the version v1.150.0.

getInstanceTypes Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of instance type IDs.

InstanceTypes List<Pulumi.AliCloud.Ecs.Outputs.GetInstanceTypesInstanceType>

A list of image types. Each element contains the following attributes:

AvailabilityZone string
CpuCoreCount int

Number of CPU cores.

EniAmount int

The maximum number of network interfaces that an instance type can be attached to.

GpuAmount int
GpuSpec string
InstanceChargeType string
InstanceTypeFamily string
IsOutdated bool
KubernetesNodeRole string
MemorySize double

Size of memory, measured in GB.

NetworkType string
OutputFile string
SortedBy string
SpotStrategy string
SystemDiskCategory string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of instance type IDs.

InstanceTypes []GetInstanceTypesInstanceType

A list of image types. Each element contains the following attributes:

AvailabilityZone string
CpuCoreCount int

Number of CPU cores.

EniAmount int

The maximum number of network interfaces that an instance type can be attached to.

GpuAmount int
GpuSpec string
InstanceChargeType string
InstanceTypeFamily string
IsOutdated bool
KubernetesNodeRole string
MemorySize float64

Size of memory, measured in GB.

NetworkType string
OutputFile string
SortedBy string
SpotStrategy string
SystemDiskCategory string
id String

The provider-assigned unique ID for this managed resource.

ids List

A list of instance type IDs.

instanceTypes ListInstanceTypesInstanceType>

A list of image types. Each element contains the following attributes:

availabilityZone String
cpuCoreCount Integer

Number of CPU cores.

eniAmount Integer

The maximum number of network interfaces that an instance type can be attached to.

gpuAmount Integer
gpuSpec String
instanceChargeType String
instanceTypeFamily String
isOutdated Boolean
kubernetesNodeRole String
memorySize Double

Size of memory, measured in GB.

networkType String
outputFile String
sortedBy String
spotStrategy String
systemDiskCategory String
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of instance type IDs.

instanceTypes GetInstanceTypesInstanceType[]

A list of image types. Each element contains the following attributes:

availabilityZone string
cpuCoreCount number

Number of CPU cores.

eniAmount number

The maximum number of network interfaces that an instance type can be attached to.

gpuAmount number
gpuSpec string
instanceChargeType string
instanceTypeFamily string
isOutdated boolean
kubernetesNodeRole string
memorySize number

Size of memory, measured in GB.

networkType string
outputFile string
sortedBy string
spotStrategy string
systemDiskCategory string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of instance type IDs.

instance_types Sequence[GetInstanceTypesInstanceType]

A list of image types. Each element contains the following attributes:

availability_zone str
cpu_core_count int

Number of CPU cores.

eni_amount int

The maximum number of network interfaces that an instance type can be attached to.

gpu_amount int
gpu_spec str
instance_charge_type str
instance_type_family str
is_outdated bool
kubernetes_node_role str
memory_size float

Size of memory, measured in GB.

network_type str
output_file str
sorted_by str
spot_strategy str
system_disk_category str
id String

The provider-assigned unique ID for this managed resource.

ids List

A list of instance type IDs.

instanceTypes List

A list of image types. Each element contains the following attributes:

availabilityZone String
cpuCoreCount Number

Number of CPU cores.

eniAmount Number

The maximum number of network interfaces that an instance type can be attached to.

gpuAmount Number
gpuSpec String
instanceChargeType String
instanceTypeFamily String
isOutdated Boolean
kubernetesNodeRole String
memorySize Number

Size of memory, measured in GB.

networkType String
outputFile String
sortedBy String
spotStrategy String
systemDiskCategory String

Supporting Types

GetInstanceTypesInstanceType

AvailabilityZones List<string>

List of availability zones that support the instance type.

BurstableInstance Pulumi.AliCloud.Ecs.Inputs.GetInstanceTypesInstanceTypeBurstableInstance

The burstable instance attribution:

CpuCoreCount int

Filter the results to a specific number of cpu cores.

EniAmount int

Filter the result whose network interface number is no more than eni_amount.

Family string

The instance type family.

Gpu Pulumi.AliCloud.Ecs.Inputs.GetInstanceTypesInstanceTypeGpu

The GPU attribution of an instance type:

Id string

ID of the instance type.

LocalStorage Pulumi.AliCloud.Ecs.Inputs.GetInstanceTypesInstanceTypeLocalStorage

Local storage of an instance type:

MemorySize double

Filter the results to a specific memory size in GB.

Price string
AvailabilityZones []string

List of availability zones that support the instance type.

BurstableInstance GetInstanceTypesInstanceTypeBurstableInstance

The burstable instance attribution:

CpuCoreCount int

Filter the results to a specific number of cpu cores.

EniAmount int

Filter the result whose network interface number is no more than eni_amount.

Family string

The instance type family.

Gpu GetInstanceTypesInstanceTypeGpu

The GPU attribution of an instance type:

Id string

ID of the instance type.

LocalStorage GetInstanceTypesInstanceTypeLocalStorage

Local storage of an instance type:

MemorySize float64

Filter the results to a specific memory size in GB.

Price string
availabilityZones List

List of availability zones that support the instance type.

burstableInstance GetInstanceTypesInstanceTypeBurstableInstance

The burstable instance attribution:

cpuCoreCount Integer

Filter the results to a specific number of cpu cores.

eniAmount Integer

Filter the result whose network interface number is no more than eni_amount.

family String

The instance type family.

gpu GetInstanceTypesInstanceTypeGpu

The GPU attribution of an instance type:

id String

ID of the instance type.

localStorage GetInstanceTypesInstanceTypeLocalStorage

Local storage of an instance type:

memorySize Double

Filter the results to a specific memory size in GB.

price String
availabilityZones string[]

List of availability zones that support the instance type.

burstableInstance GetInstanceTypesInstanceTypeBurstableInstance

The burstable instance attribution:

cpuCoreCount number

Filter the results to a specific number of cpu cores.

eniAmount number

Filter the result whose network interface number is no more than eni_amount.

family string

The instance type family.

gpu GetInstanceTypesInstanceTypeGpu

The GPU attribution of an instance type:

id string

ID of the instance type.

localStorage GetInstanceTypesInstanceTypeLocalStorage

Local storage of an instance type:

memorySize number

Filter the results to a specific memory size in GB.

price string
availability_zones Sequence[str]

List of availability zones that support the instance type.

burstable_instance GetInstanceTypesInstanceTypeBurstableInstance

The burstable instance attribution:

cpu_core_count int

Filter the results to a specific number of cpu cores.

eni_amount int

Filter the result whose network interface number is no more than eni_amount.

family str

The instance type family.

gpu GetInstanceTypesInstanceTypeGpu

The GPU attribution of an instance type:

id str

ID of the instance type.

local_storage GetInstanceTypesInstanceTypeLocalStorage

Local storage of an instance type:

memory_size float

Filter the results to a specific memory size in GB.

price str
availabilityZones List

List of availability zones that support the instance type.

burstableInstance Property Map

The burstable instance attribution:

cpuCoreCount Number

Filter the results to a specific number of cpu cores.

eniAmount Number

Filter the result whose network interface number is no more than eni_amount.

family String

The instance type family.

gpu Property Map

The GPU attribution of an instance type:

id String

ID of the instance type.

localStorage Property Map

Local storage of an instance type:

memorySize Number

Filter the results to a specific memory size in GB.

price String

GetInstanceTypesInstanceTypeBurstableInstance

BaselineCredit string

The compute performance benchmark CPU credit of a burstable instance.

InitialCredit string

The initial CPU credit of a burstable instance.

BaselineCredit string

The compute performance benchmark CPU credit of a burstable instance.

InitialCredit string

The initial CPU credit of a burstable instance.

baselineCredit String

The compute performance benchmark CPU credit of a burstable instance.

initialCredit String

The initial CPU credit of a burstable instance.

baselineCredit string

The compute performance benchmark CPU credit of a burstable instance.

initialCredit string

The initial CPU credit of a burstable instance.

baseline_credit str

The compute performance benchmark CPU credit of a burstable instance.

initial_credit str

The initial CPU credit of a burstable instance.

baselineCredit String

The compute performance benchmark CPU credit of a burstable instance.

initialCredit String

The initial CPU credit of a burstable instance.

GetInstanceTypesInstanceTypeGpu

Amount string

The number of local storage devices that an instance has been attached to.

Category string

The category of local storage that an instance has been attached to.

Amount string

The number of local storage devices that an instance has been attached to.

Category string

The category of local storage that an instance has been attached to.

amount String

The number of local storage devices that an instance has been attached to.

category String

The category of local storage that an instance has been attached to.

amount string

The number of local storage devices that an instance has been attached to.

category string

The category of local storage that an instance has been attached to.

amount str

The number of local storage devices that an instance has been attached to.

category str

The category of local storage that an instance has been attached to.

amount String

The number of local storage devices that an instance has been attached to.

category String

The category of local storage that an instance has been attached to.

GetInstanceTypesInstanceTypeLocalStorage

Amount string

The number of local storage devices that an instance has been attached to.

Capacity string

The capacity of a local storage in GB.

Category string

The category of local storage that an instance has been attached to.

Amount string

The number of local storage devices that an instance has been attached to.

Capacity string

The capacity of a local storage in GB.

Category string

The category of local storage that an instance has been attached to.

amount String

The number of local storage devices that an instance has been attached to.

capacity String

The capacity of a local storage in GB.

category String

The category of local storage that an instance has been attached to.

amount string

The number of local storage devices that an instance has been attached to.

capacity string

The capacity of a local storage in GB.

category string

The category of local storage that an instance has been attached to.

amount str

The number of local storage devices that an instance has been attached to.

capacity str

The capacity of a local storage in GB.

category str

The category of local storage that an instance has been attached to.

amount String

The number of local storage devices that an instance has been attached to.

capacity String

The capacity of a local storage in GB.

category String

The category of local storage that an instance has been attached to.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.