1. Packages
  2. Linode
  3. API Docs
  4. getInstanceTypes
Linode v4.21.0 published on Friday, Jun 7, 2024 by Pulumi

linode.getInstanceTypes

Explore with Pulumi AI

linode logo
Linode v4.21.0 published on Friday, Jun 7, 2024 by Pulumi

    Provides information about Linode Instance types that match a set of filters.

    Example Usage

    Get information about all Linode Instance types with a certain number of VCPUs:

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const specific-types = linode.getInstanceTypes({
        filters: [{
            name: "vcpus",
            values: ["2"],
        }],
    });
    export const typeIds = specific_types.then(specific_types => specific_types.types.map(__item => __item.id));
    
    import pulumi
    import pulumi_linode as linode
    
    specific_types = linode.get_instance_types(filters=[linode.GetInstanceTypesFilterArgs(
        name="vcpus",
        values=["2"],
    )])
    pulumi.export("typeIds", [__item.id for __item in specific_types.types])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		specific_types, err := linode.GetInstanceTypes(ctx, &linode.GetInstanceTypesArgs{
    			Filters: []linode.GetInstanceTypesFilter{
    				{
    					Name: "vcpus",
    					Values: []string{
    						"2",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var splat0 []*string
    		for _, val0 := range specific_types.Types {
    			splat0 = append(splat0, val0.Id)
    		}
    		ctx.Export("typeIds", splat0)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var specific_types = Linode.GetInstanceTypes.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetInstanceTypesFilterInputArgs
                {
                    Name = "vcpus",
                    Values = new[]
                    {
                        "2",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["typeIds"] = specific_types.Apply(specific_types => specific_types.Apply(getInstanceTypesResult => getInstanceTypesResult.Types).Select(__item => __item.Id).ToList()),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetInstanceTypesArgs;
    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 specific-types = LinodeFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .filters(GetInstanceTypesFilterArgs.builder()
                    .name("vcpus")
                    .values(2)
                    .build())
                .build());
    
            ctx.export("typeIds", specific_types.types().stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Get information about all Linode Instance types:

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const all-types = linode.getInstanceTypes({});
    export const typeIds = all_types.then(all_types => all_types.types.map(__item => __item.id));
    
    import pulumi
    import pulumi_linode as linode
    
    all_types = linode.get_instance_types()
    pulumi.export("typeIds", [__item.id for __item in all_types.types])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all_types, err := linode.GetInstanceTypes(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		var splat0 []*string
    		for _, val0 := range all_types.Types {
    			splat0 = append(splat0, val0.Id)
    		}
    		ctx.Export("typeIds", splat0)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var all_types = Linode.GetInstanceTypes.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["typeIds"] = all_types.Apply(all_types => all_types.Apply(getInstanceTypesResult => getInstanceTypesResult.Types).Select(__item => __item.Id).ToList()),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetInstanceTypesArgs;
    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 all-types = LinodeFunctions.getInstanceTypes();
    
            ctx.export("typeIds", all_types.types().stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Filterable Fields

    • class

    • disk

    • gpus

    • label

    • memory

    • network_out

    • transfer

    • vcpus

    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(filters: Optional[Sequence[GetInstanceTypesFilter]] = None,
                           order: Optional[str] = None,
                           order_by: Optional[str] = None,
                           types: Optional[Sequence[GetInstanceTypesType]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetInstanceTypesResult
    def get_instance_types_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceTypesFilterArgs]]]] = None,
                           order: Optional[pulumi.Input[str]] = None,
                           order_by: Optional[pulumi.Input[str]] = None,
                           types: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceTypesTypeArgs]]]] = 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: linode:index/getInstanceTypes:getInstanceTypes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetInstanceTypesFilter>
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Types List<GetInstanceTypesType>
    Filters []GetInstanceTypesFilter
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Types []GetInstanceTypesType
    filters List<GetInstanceTypesFilter>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    types List<GetInstanceTypesType>
    filters GetInstanceTypesFilter[]
    order string
    The order in which results should be returned. (asc, desc; default asc)
    orderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    types GetInstanceTypesType[]
    filters Sequence[GetInstanceTypesFilter]
    order str
    The order in which results should be returned. (asc, desc; default asc)
    order_by str
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    types Sequence[GetInstanceTypesType]
    filters List<Property Map>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    types List<Property Map>

    getInstanceTypes Result

    The following output properties are available:

    Id string
    The ID representing the Linode Type.
    Filters List<GetInstanceTypesFilter>
    Order string
    OrderBy string
    Types List<GetInstanceTypesType>
    Id string
    The ID representing the Linode Type.
    Filters []GetInstanceTypesFilter
    Order string
    OrderBy string
    Types []GetInstanceTypesType
    id String
    The ID representing the Linode Type.
    filters List<GetInstanceTypesFilter>
    order String
    orderBy String
    types List<GetInstanceTypesType>
    id string
    The ID representing the Linode Type.
    filters GetInstanceTypesFilter[]
    order string
    orderBy string
    types GetInstanceTypesType[]
    id String
    The ID representing the Linode Type.
    filters List<Property Map>
    order String
    orderBy String
    types List<Property Map>

    Supporting Types

    GetInstanceTypesFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetInstanceTypesType

    Addons List<GetInstanceTypesTypeAddon>
    Information about the optional Backup service offered for Linodes.
    Class string
    The class of the Linode Type. See all classes here.
    Disk int
    The Disk size, in MB, of the Linode Type.
    Id string
    The ID representing the Linode Type.
    Label string
    The Linode Type's label is for display purposes only.
    Memory int
    The amount of RAM included in this Linode Type.
    NetworkOut int
    The Mbits outbound bandwidth allocation.
    Prices List<GetInstanceTypesTypePrice>
    Cost in US dollars, broken down into hourly and monthly charges.
    RegionPrices List<GetInstanceTypesTypeRegionPrice>
    A list of region-specific prices for this plan.
    Transfer int
    The monthly outbound transfer amount, in MB.
    Vcpus int
    The number of VCPU cores this Linode Type offers.
    Addons []GetInstanceTypesTypeAddon
    Information about the optional Backup service offered for Linodes.
    Class string
    The class of the Linode Type. See all classes here.
    Disk int
    The Disk size, in MB, of the Linode Type.
    Id string
    The ID representing the Linode Type.
    Label string
    The Linode Type's label is for display purposes only.
    Memory int
    The amount of RAM included in this Linode Type.
    NetworkOut int
    The Mbits outbound bandwidth allocation.
    Prices []GetInstanceTypesTypePrice
    Cost in US dollars, broken down into hourly and monthly charges.
    RegionPrices []GetInstanceTypesTypeRegionPrice
    A list of region-specific prices for this plan.
    Transfer int
    The monthly outbound transfer amount, in MB.
    Vcpus int
    The number of VCPU cores this Linode Type offers.
    addons List<GetInstanceTypesTypeAddon>
    Information about the optional Backup service offered for Linodes.
    class_ String
    The class of the Linode Type. See all classes here.
    disk Integer
    The Disk size, in MB, of the Linode Type.
    id String
    The ID representing the Linode Type.
    label String
    The Linode Type's label is for display purposes only.
    memory Integer
    The amount of RAM included in this Linode Type.
    networkOut Integer
    The Mbits outbound bandwidth allocation.
    prices List<GetInstanceTypesTypePrice>
    Cost in US dollars, broken down into hourly and monthly charges.
    regionPrices List<GetInstanceTypesTypeRegionPrice>
    A list of region-specific prices for this plan.
    transfer Integer
    The monthly outbound transfer amount, in MB.
    vcpus Integer
    The number of VCPU cores this Linode Type offers.
    addons GetInstanceTypesTypeAddon[]
    Information about the optional Backup service offered for Linodes.
    class string
    The class of the Linode Type. See all classes here.
    disk number
    The Disk size, in MB, of the Linode Type.
    id string
    The ID representing the Linode Type.
    label string
    The Linode Type's label is for display purposes only.
    memory number
    The amount of RAM included in this Linode Type.
    networkOut number
    The Mbits outbound bandwidth allocation.
    prices GetInstanceTypesTypePrice[]
    Cost in US dollars, broken down into hourly and monthly charges.
    regionPrices GetInstanceTypesTypeRegionPrice[]
    A list of region-specific prices for this plan.
    transfer number
    The monthly outbound transfer amount, in MB.
    vcpus number
    The number of VCPU cores this Linode Type offers.
    addons Sequence[GetInstanceTypesTypeAddon]
    Information about the optional Backup service offered for Linodes.
    class_ str
    The class of the Linode Type. See all classes here.
    disk int
    The Disk size, in MB, of the Linode Type.
    id str
    The ID representing the Linode Type.
    label str
    The Linode Type's label is for display purposes only.
    memory int
    The amount of RAM included in this Linode Type.
    network_out int
    The Mbits outbound bandwidth allocation.
    prices Sequence[GetInstanceTypesTypePrice]
    Cost in US dollars, broken down into hourly and monthly charges.
    region_prices Sequence[GetInstanceTypesTypeRegionPrice]
    A list of region-specific prices for this plan.
    transfer int
    The monthly outbound transfer amount, in MB.
    vcpus int
    The number of VCPU cores this Linode Type offers.
    addons List<Property Map>
    Information about the optional Backup service offered for Linodes.
    class String
    The class of the Linode Type. See all classes here.
    disk Number
    The Disk size, in MB, of the Linode Type.
    id String
    The ID representing the Linode Type.
    label String
    The Linode Type's label is for display purposes only.
    memory Number
    The amount of RAM included in this Linode Type.
    networkOut Number
    The Mbits outbound bandwidth allocation.
    prices List<Property Map>
    Cost in US dollars, broken down into hourly and monthly charges.
    regionPrices List<Property Map>
    A list of region-specific prices for this plan.
    transfer Number
    The monthly outbound transfer amount, in MB.
    vcpus Number
    The number of VCPU cores this Linode Type offers.

    GetInstanceTypesTypeAddon

    GetInstanceTypesTypeAddonBackup

    GetInstanceTypesTypeAddonBackupPrice

    Hourly double
    The cost (in US dollars) per hour to add Backups service.
    Monthly double
    The cost (in US dollars) per month to add Backups service.
    Hourly float64
    The cost (in US dollars) per hour to add Backups service.
    Monthly float64
    The cost (in US dollars) per month to add Backups service.
    hourly Double
    The cost (in US dollars) per hour to add Backups service.
    monthly Double
    The cost (in US dollars) per month to add Backups service.
    hourly number
    The cost (in US dollars) per hour to add Backups service.
    monthly number
    The cost (in US dollars) per month to add Backups service.
    hourly float
    The cost (in US dollars) per hour to add Backups service.
    monthly float
    The cost (in US dollars) per month to add Backups service.
    hourly Number
    The cost (in US dollars) per hour to add Backups service.
    monthly Number
    The cost (in US dollars) per month to add Backups service.

    GetInstanceTypesTypeAddonBackupRegionPrice

    Hourly double
    Id string
    The ID representing the Linode Type.
    Monthly double
    Hourly float64
    Id string
    The ID representing the Linode Type.
    Monthly float64
    hourly Double
    id String
    The ID representing the Linode Type.
    monthly Double
    hourly number
    id string
    The ID representing the Linode Type.
    monthly number
    hourly float
    id str
    The ID representing the Linode Type.
    monthly float
    hourly Number
    id String
    The ID representing the Linode Type.
    monthly Number

    GetInstanceTypesTypePrice

    Hourly double
    Cost (in US dollars) per hour.
    Monthly double
    Cost (in US dollars) per month.
    Hourly float64
    Cost (in US dollars) per hour.
    Monthly float64
    Cost (in US dollars) per month.
    hourly Double
    Cost (in US dollars) per hour.
    monthly Double
    Cost (in US dollars) per month.
    hourly number
    Cost (in US dollars) per hour.
    monthly number
    Cost (in US dollars) per month.
    hourly float
    Cost (in US dollars) per hour.
    monthly float
    Cost (in US dollars) per month.
    hourly Number
    Cost (in US dollars) per hour.
    monthly Number
    Cost (in US dollars) per month.

    GetInstanceTypesTypeRegionPrice

    Hourly double
    Id string
    The ID representing the Linode Type.
    Monthly double
    Hourly float64
    Id string
    The ID representing the Linode Type.
    Monthly float64
    hourly Double
    id String
    The ID representing the Linode Type.
    monthly Double
    hourly number
    id string
    The ID representing the Linode Type.
    monthly number
    hourly float
    id str
    The ID representing the Linode Type.
    monthly float
    hourly Number
    id String
    The ID representing the Linode Type.
    monthly Number

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.21.0 published on Friday, Jun 7, 2024 by Pulumi