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

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var typesDs = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.cpuCoreCount(1)
.memorySize(2)
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.instanceType(typesDs.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.build());
}
}

Return

A collection of values returned by getInstanceTypes.

Parameters

argument

A collection of arguments for invoking getInstanceTypes.


suspend fun getInstanceTypes(availabilityZone: String? = null, cpuCoreCount: Int? = null, eniAmount: Int? = null, gpuAmount: Int? = null, gpuSpec: String? = null, imageId: String? = null, instanceChargeType: String? = null, instanceTypeFamily: String? = null, isOutdated: Boolean? = null, kubernetesNodeRole: String? = null, memorySize: Double? = null, minimumEniIpv6AddressQuantity: Int? = null, networkType: String? = null, outputFile: String? = null, sortedBy: String? = null, spotStrategy: String? = null, systemDiskCategory: String? = null): GetInstanceTypesResult

Return

A collection of values returned by getInstanceTypes.

See also

Parameters

availabilityZone

The zone where instance types are supported.

cpuCoreCount

Filter the results to a specific number of cpu cores.

eniAmount

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

gpuAmount

The GPU amount of an instance type.

gpuSpec

The GPU spec of an instance type.

imageId

The ID of the image.

instanceChargeType

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

instanceTypeFamily

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

isOutdated

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

kubernetesNodeRole

Filter the result which is used to create a kubernetes cluster and managed kubernetes cluster. Optional Values: Master and Worker.

memorySize

Filter the results to a specific memory size in GB.

minimumEniIpv6AddressQuantity

The minimum number of IPv6 addresses per ENI. Note: If an instance type supports fewer IPv6 addresses per ENI than the specified value, information about the instance type is not queried.

networkType

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

outputFile

File name where to save data source results (after running pulumi preview).

sortedBy
spotStrategy

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

systemDiskCategory

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.


Return

A collection of values returned by getInstanceTypes.

See also

Parameters

argument

Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetInstanceTypesPlainArgs.