1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getInstanceTypeFamilies
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

alicloud.ecs.getInstanceTypeFamilies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

    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);
    
    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)
    
    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
    	})
    }
    
    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)),
        };
    });
    
    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());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:ecs:getInstanceTypeFamilies
          Arguments:
            instanceChargeType: PrePaid
    outputs:
      firstInstanceTypeFamilyId: ${default.families[0].id}
      instanceIds: ${default.ids}
    

    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>
    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]
    func GetInstanceTypeFamilies(ctx *Context, args *GetInstanceTypeFamiliesArgs, opts ...InvokeOption) (*GetInstanceTypeFamiliesResult, error)
    func GetInstanceTypeFamiliesOutput(ctx *Context, args *GetInstanceTypeFamiliesOutputArgs, opts ...InvokeOption) GetInstanceTypeFamiliesResultOutput

    > 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)
    }
    public static CompletableFuture<GetInstanceTypeFamiliesResult> getInstanceTypeFamilies(GetInstanceTypeFamiliesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getInstanceTypeFamilies:getInstanceTypeFamilies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Generation 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 string
    Valid values are PrePaid, PostPaid, Default to PostPaid.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SpotStrategy string
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    ZoneId string
    The Zone to launch the instance.
    Generation 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 string
    Valid values are PrePaid, PostPaid, Default to PostPaid.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SpotStrategy string
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    ZoneId string
    The Zone to launch the instance.
    generation 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 String
    Valid values are PrePaid, PostPaid, Default to PostPaid.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    spotStrategy String
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    zoneId String
    The Zone to launch the instance.
    generation 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 string
    Valid values are PrePaid, PostPaid, Default to PostPaid.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    spotStrategy string
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    zoneId string
    The Zone to launch the instance.
    generation 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 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 str
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    zone_id str
    The Zone to launch the instance.
    generation 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 String
    Valid values are PrePaid, PostPaid, Default to PostPaid.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    spotStrategy String
    Filter the results by ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
    zoneId 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 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 string
    ID of the instance type family.
    ZoneIds List<string>
    A list of Zone to launch the instance.
    Generation 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 string
    ID of the instance type family.
    ZoneIds []string
    A list of Zone to launch the instance.
    generation 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 String
    ID of the instance type family.
    zoneIds List<String>
    A list of Zone to launch the instance.
    generation 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 string
    ID of the instance type family.
    zoneIds string[]
    A list of Zone to launch the instance.
    generation 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 str
    ID of the instance type family.
    zone_ids Sequence[str]
    A list of Zone to launch the instance.
    generation 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 String
    ID of the instance type family.
    zoneIds 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.
    alicloud logo
    Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi