1. Packages
  2. Linode
  3. API Docs
  4. getRegions
Linode v4.23.0 published on Thursday, Jul 18, 2024 by Pulumi

linode.getRegions

Explore with Pulumi AI

linode logo
Linode v4.23.0 published on Thursday, Jul 18, 2024 by Pulumi

    Provides information about Linode regions that match a set of filters. For more information, see the Linode APIv4 docs.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filtered-regions = linode.getRegions({
        filters: [
            {
                name: "status",
                values: ["ok"],
            },
            {
                name: "capabilities",
                values: ["NodeBalancers"],
            },
        ],
    });
    export const regions = filtered_regions.then(filtered_regions => filtered_regions.regions);
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_regions = linode.get_regions(filters=[
        linode.GetRegionsFilterArgs(
            name="status",
            values=["ok"],
        ),
        linode.GetRegionsFilterArgs(
            name="capabilities",
            values=["NodeBalancers"],
        ),
    ])
    pulumi.export("regions", filtered_regions.regions)
    
    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 {
    		filtered_regions, err := linode.GetRegions(ctx, &linode.GetRegionsArgs{
    			Filters: []linode.GetRegionsFilter{
    				{
    					Name: "status",
    					Values: []string{
    						"ok",
    					},
    				},
    				{
    					Name: "capabilities",
    					Values: []string{
    						"NodeBalancers",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("regions", filtered_regions.Regions)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered_regions = Linode.GetRegions.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetRegionsFilterInputArgs
                {
                    Name = "status",
                    Values = new[]
                    {
                        "ok",
                    },
                },
                new Linode.Inputs.GetRegionsFilterInputArgs
                {
                    Name = "capabilities",
                    Values = new[]
                    {
                        "NodeBalancers",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["regions"] = filtered_regions.Apply(filtered_regions => filtered_regions.Apply(getRegionsResult => getRegionsResult.Regions)),
        };
    });
    
    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.GetRegionsArgs;
    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 filtered-regions = LinodeFunctions.getRegions(GetRegionsArgs.builder()
                .filters(            
                    GetRegionsFilterArgs.builder()
                        .name("status")
                        .values("ok")
                        .build(),
                    GetRegionsFilterArgs.builder()
                        .name("capabilities")
                        .values("NodeBalancers")
                        .build())
                .build());
    
            ctx.export("regions", filtered_regions.regions());
        }
    }
    
    variables:
      filtered-regions:
        fn::invoke:
          Function: linode:getRegions
          Arguments:
            filters:
              - name: status
                values:
                  - ok
              - name: capabilities
                values:
                  - NodeBalancers
    outputs:
      regions: ${["filtered-regions"].regions}
    

    Filterable Fields

    • status

    • country

    • capabilities

    • site_type

    Using getRegions

    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 getRegions(args: GetRegionsArgs, opts?: InvokeOptions): Promise<GetRegionsResult>
    function getRegionsOutput(args: GetRegionsOutputArgs, opts?: InvokeOptions): Output<GetRegionsResult>
    def get_regions(filters: Optional[Sequence[GetRegionsFilter]] = None,
                    regions: Optional[Sequence[GetRegionsRegion]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRegionsResult
    def get_regions_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetRegionsFilterArgs]]]] = None,
                    regions: Optional[pulumi.Input[Sequence[pulumi.Input[GetRegionsRegionArgs]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRegionsResult]
    func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)
    func GetRegionsOutput(ctx *Context, args *GetRegionsOutputArgs, opts ...InvokeOption) GetRegionsResultOutput

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

    public static class GetRegions 
    {
        public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args, InvokeOptions? opts = null)
        public static Output<GetRegionsResult> Invoke(GetRegionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getRegions:getRegions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getRegions Result

    The following output properties are available:

    Supporting Types

    GetRegionsFilter

    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)

    GetRegionsRegion

    Capabilities List<string>
    A list of capabilities of this region.
    Country string
    The country the region resides in.
    Id string
    The unique ID of this Region.
    Label string
    Detailed location information for this Region, including city, state or region, and country.
    PlacementGroupLimits List<GetRegionsRegionPlacementGroupLimit>
    Information about placement groups limits for this region.
    SiteType string
    The type of this region.
    Status string
    This region’s current operational status (ok or outage).
    Resolvers List<GetRegionsRegionResolver>
    Capabilities []string
    A list of capabilities of this region.
    Country string
    The country the region resides in.
    Id string
    The unique ID of this Region.
    Label string
    Detailed location information for this Region, including city, state or region, and country.
    PlacementGroupLimits []GetRegionsRegionPlacementGroupLimit
    Information about placement groups limits for this region.
    SiteType string
    The type of this region.
    Status string
    This region’s current operational status (ok or outage).
    Resolvers []GetRegionsRegionResolver
    capabilities List<String>
    A list of capabilities of this region.
    country String
    The country the region resides in.
    id String
    The unique ID of this Region.
    label String
    Detailed location information for this Region, including city, state or region, and country.
    placementGroupLimits List<GetRegionsRegionPlacementGroupLimit>
    Information about placement groups limits for this region.
    siteType String
    The type of this region.
    status String
    This region’s current operational status (ok or outage).
    resolvers List<GetRegionsRegionResolver>
    capabilities string[]
    A list of capabilities of this region.
    country string
    The country the region resides in.
    id string
    The unique ID of this Region.
    label string
    Detailed location information for this Region, including city, state or region, and country.
    placementGroupLimits GetRegionsRegionPlacementGroupLimit[]
    Information about placement groups limits for this region.
    siteType string
    The type of this region.
    status string
    This region’s current operational status (ok or outage).
    resolvers GetRegionsRegionResolver[]
    capabilities Sequence[str]
    A list of capabilities of this region.
    country str
    The country the region resides in.
    id str
    The unique ID of this Region.
    label str
    Detailed location information for this Region, including city, state or region, and country.
    placement_group_limits Sequence[GetRegionsRegionPlacementGroupLimit]
    Information about placement groups limits for this region.
    site_type str
    The type of this region.
    status str
    This region’s current operational status (ok or outage).
    resolvers Sequence[GetRegionsRegionResolver]
    capabilities List<String>
    A list of capabilities of this region.
    country String
    The country the region resides in.
    id String
    The unique ID of this Region.
    label String
    Detailed location information for this Region, including city, state or region, and country.
    placementGroupLimits List<Property Map>
    Information about placement groups limits for this region.
    siteType String
    The type of this region.
    status String
    This region’s current operational status (ok or outage).
    resolvers List<Property Map>

    GetRegionsRegionPlacementGroupLimit

    MaximumLinodesPerPg int
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    MaximumPgsPerCustomer int
    The maximum number of placement groups allowed for the current user in this region.
    MaximumLinodesPerPg int
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    MaximumPgsPerCustomer int
    The maximum number of placement groups allowed for the current user in this region.
    maximumLinodesPerPg Integer
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    maximumPgsPerCustomer Integer
    The maximum number of placement groups allowed for the current user in this region.
    maximumLinodesPerPg number
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    maximumPgsPerCustomer number
    The maximum number of placement groups allowed for the current user in this region.
    maximum_linodes_per_pg int
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    maximum_pgs_per_customer int
    The maximum number of placement groups allowed for the current user in this region.
    maximumLinodesPerPg Number
    The maximum number of Linodes allowed to be assigned to a placement group in this region.
    maximumPgsPerCustomer Number
    The maximum number of placement groups allowed for the current user in this region.

    GetRegionsRegionResolver

    Ipv4 string
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    Ipv6 string
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.
    Ipv4 string
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    Ipv6 string
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.
    ipv4 String
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    ipv6 String
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.
    ipv4 string
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    ipv6 string
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.
    ipv4 str
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    ipv6 str
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.
    ipv4 String
    The IPv4 addresses for this region’s DNS resolvers, separated by commas.
    ipv6 String
    The IPv6 addresses for this region’s DNS resolvers, separated by commas.

    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.23.0 published on Thursday, Jul 18, 2024 by Pulumi