1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. getInstanceTypeFamilies
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ecs.getInstanceTypeFamilies

Explore with Pulumi AI

This data source provides the ECS instance type families of Alibaba Cloud.

NOTE: Available in 1.54.0+

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = alicloud.ecs.getInstanceTypeFamilies({
    instanceChargeType: "PrePaid",
});
export const firstInstanceTypeFamilyId = _default.then(_default => _default.families?.[0]?.id);
export const instanceIds = _default.then(_default => _default.ids);
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.ecs.get_instance_type_families(instance_charge_type="PrePaid")
pulumi.export("firstInstanceTypeFamilyId", default.families[0].id)
pulumi.export("instanceIds", default.ids)
Copy
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 {
		_default, err := ecs.GetInstanceTypeFamilies(ctx, &ecs.GetInstanceTypeFamiliesArgs{
			InstanceChargeType: pulumi.StringRef("PrePaid"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstInstanceTypeFamilyId", _default.Families[0].Id)
		ctx.Export("instanceIds", _default.Ids)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.Ecs.GetInstanceTypeFamilies.Invoke(new()
    {
        InstanceChargeType = "PrePaid",
    });

    return new Dictionary<string, object?>
    {
        ["firstInstanceTypeFamilyId"] = @default.Apply(@default => @default.Apply(getInstanceTypeFamiliesResult => getInstanceTypeFamiliesResult.Families[0]?.Id)),
        ["instanceIds"] = @default.Apply(@default => @default.Apply(getInstanceTypeFamiliesResult => getInstanceTypeFamiliesResult.Ids)),
    };
});
Copy
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.GetInstanceTypeFamiliesArgs;
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 default = EcsFunctions.getInstanceTypeFamilies(GetInstanceTypeFamiliesArgs.builder()
            .instanceChargeType("PrePaid")
            .build());

        ctx.export("firstInstanceTypeFamilyId", default_.families()[0].id());
        ctx.export("instanceIds", default_.ids());
    }
}
Copy
variables:
  default:
    fn::invoke:
      function: alicloud:ecs:getInstanceTypeFamilies
      arguments:
        instanceChargeType: PrePaid
outputs:
  firstInstanceTypeFamilyId: ${default.families[0].id}
  instanceIds: ${default.ids}
Copy

Using getInstanceTypeFamilies

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 getInstanceTypeFamilies(args: GetInstanceTypeFamiliesArgs, opts?: InvokeOptions): Promise<GetInstanceTypeFamiliesResult>
function getInstanceTypeFamiliesOutput(args: GetInstanceTypeFamiliesOutputArgs, opts?: InvokeOptions): Output<GetInstanceTypeFamiliesResult>
Copy
def get_instance_type_families(generation: Optional[str] = None,
                               instance_charge_type: Optional[str] = None,
                               output_file: Optional[str] = None,
                               spot_strategy: Optional[str] = None,
                               zone_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetInstanceTypeFamiliesResult
def get_instance_type_families_output(generation: Optional[pulumi.Input[str]] = None,
                               instance_charge_type: Optional[pulumi.Input[str]] = None,
                               output_file: Optional[pulumi.Input[str]] = None,
                               spot_strategy: Optional[pulumi.Input[str]] = None,
                               zone_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetInstanceTypeFamiliesResult]
Copy
func GetInstanceTypeFamilies(ctx *Context, args *GetInstanceTypeFamiliesArgs, opts ...InvokeOption) (*GetInstanceTypeFamiliesResult, error)
func GetInstanceTypeFamiliesOutput(ctx *Context, args *GetInstanceTypeFamiliesOutputArgs, opts ...InvokeOption) GetInstanceTypeFamiliesResultOutput
Copy

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

public static class GetInstanceTypeFamilies 
{
    public static Task<GetInstanceTypeFamiliesResult> InvokeAsync(GetInstanceTypeFamiliesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceTypeFamiliesResult> Invoke(GetInstanceTypeFamiliesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetInstanceTypeFamiliesResult> getInstanceTypeFamilies(GetInstanceTypeFamiliesArgs args, InvokeOptions options)
public static Output<GetInstanceTypeFamiliesResult> getInstanceTypeFamilies(GetInstanceTypeFamiliesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ecs/getInstanceTypeFamilies:getInstanceTypeFamilies
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Generation Changes to this property will trigger replacement. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
InstanceChargeType Changes to this property will trigger replacement. string
Valid values are PrePaid, PostPaid, Default to PostPaid.
OutputFile string
File name where to save data source results (after running pulumi preview).
SpotStrategy Changes to this property will trigger replacement. string
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
ZoneId Changes to this property will trigger replacement. string
The Zone to launch the instance.
Generation Changes to this property will trigger replacement. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
InstanceChargeType Changes to this property will trigger replacement. string
Valid values are PrePaid, PostPaid, Default to PostPaid.
OutputFile string
File name where to save data source results (after running pulumi preview).
SpotStrategy Changes to this property will trigger replacement. string
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
ZoneId Changes to this property will trigger replacement. string
The Zone to launch the instance.
generation Changes to this property will trigger replacement. String
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
instanceChargeType Changes to this property will trigger replacement. String
Valid values are PrePaid, PostPaid, Default to PostPaid.
outputFile String
File name where to save data source results (after running pulumi preview).
spotStrategy Changes to this property will trigger replacement. String
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
zoneId Changes to this property will trigger replacement. String
The Zone to launch the instance.
generation Changes to this property will trigger replacement. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
instanceChargeType Changes to this property will trigger replacement. string
Valid values are PrePaid, PostPaid, Default to PostPaid.
outputFile string
File name where to save data source results (after running pulumi preview).
spotStrategy Changes to this property will trigger replacement. string
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
zoneId Changes to this property will trigger replacement. string
The Zone to launch the instance.
generation Changes to this property will trigger replacement. str
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
instance_charge_type Changes to this property will trigger replacement. str
Valid values are PrePaid, PostPaid, Default to PostPaid.
output_file str
File name where to save data source results (after running pulumi preview).
spot_strategy Changes to this property will trigger replacement. str
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
zone_id Changes to this property will trigger replacement. str
The Zone to launch the instance.
generation Changes to this property will trigger replacement. String
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
instanceChargeType Changes to this property will trigger replacement. String
Valid values are PrePaid, PostPaid, Default to PostPaid.
outputFile String
File name where to save data source results (after running pulumi preview).
spotStrategy Changes to this property will trigger replacement. String
Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
zoneId Changes to this property will trigger replacement. String
The Zone to launch the instance.

getInstanceTypeFamilies Result

The following output properties are available:

Families List<Pulumi.AliCloud.Ecs.Outputs.GetInstanceTypeFamiliesFamily>
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of instance type family IDs.
Generation string
The generation of the instance type family.
InstanceChargeType string
OutputFile string
SpotStrategy string
ZoneId string
Families []GetInstanceTypeFamiliesFamily
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of instance type family IDs.
Generation string
The generation of the instance type family.
InstanceChargeType string
OutputFile string
SpotStrategy string
ZoneId string
families List<GetInstanceTypeFamiliesFamily>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of instance type family IDs.
generation String
The generation of the instance type family.
instanceChargeType String
outputFile String
spotStrategy String
zoneId String
families GetInstanceTypeFamiliesFamily[]
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of instance type family IDs.
generation string
The generation of the instance type family.
instanceChargeType string
outputFile string
spotStrategy string
zoneId string
families Sequence[GetInstanceTypeFamiliesFamily]
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of instance type family IDs.
generation str
The generation of the instance type family.
instance_charge_type str
output_file str
spot_strategy str
zone_id str
families List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of instance type family IDs.
generation String
The generation of the instance type family.
instanceChargeType String
outputFile String
spotStrategy String
zoneId String

Supporting Types

GetInstanceTypeFamiliesFamily

Generation This property is required. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
Id This property is required. string
ID of the instance type family.
ZoneIds This property is required. List<string>
A list of Zone to launch the instance.
Generation This property is required. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
Id This property is required. string
ID of the instance type family.
ZoneIds This property is required. []string
A list of Zone to launch the instance.
generation This property is required. String
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
id This property is required. String
ID of the instance type family.
zoneIds This property is required. List<String>
A list of Zone to launch the instance.
generation This property is required. string
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
id This property is required. string
ID of the instance type family.
zoneIds This property is required. string[]
A list of Zone to launch the instance.
generation This property is required. str
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
id This property is required. str
ID of the instance type family.
zone_ids This property is required. Sequence[str]
A list of Zone to launch the instance.
generation This property is required. String
The generation of the instance type family, Valid values: ecs-1, ecs-2, ecs-3, ecs-4, ecs-5, ecs-6. For more information, see Instance type families.
id This property is required. String
ID of the instance type family.
zoneIds This property is required. List<String>
A list of Zone to launch the instance.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.