1. Packages
  2. Linode Provider
  3. API Docs
  4. getRegions
Linode v4.37.0 published on Thursday, Apr 10, 2025 by Pulumi

linode.getRegions

Explore with Pulumi AI

Linode v4.37.0 published on Thursday, Apr 10, 2025 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);
Copy
import pulumi
import pulumi_linode as linode

filtered_regions = linode.get_regions(filters=[
    {
        "name": "status",
        "values": ["ok"],
    },
    {
        "name": "capabilities",
        "values": ["NodeBalancers"],
    },
])
pulumi.export("regions", filtered_regions.regions)
Copy
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
	})
}
Copy
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)),
    };
});
Copy
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());
    }
}
Copy
variables:
  filtered-regions:
    fn::invoke:
      function: linode:getRegions
      arguments:
        filters:
          - name: status
            values:
              - ok
          - name: capabilities
            values:
              - NodeBalancers
outputs:
  regions: ${["filtered-regions"].regions}
Copy

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>
Copy
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]
Copy
func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)
func GetRegionsOutput(ctx *Context, args *GetRegionsOutputArgs, opts ...InvokeOption) GetRegionsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
public static Output<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getRegions:getRegions
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

getRegions Result

The following output properties are available:

Supporting Types

GetRegionsFilter

Name This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
Values This property is required. 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 This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
Values This property is required. []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 This property is required. String
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. 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 This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. 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 This property is required. str
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. 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 This property is required. String
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. 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 This property is required. List<string>
A list of capabilities of this region.
Country This property is required. string
The country the region resides in.
Id This property is required. string
The unique ID of this Region.
Label This property is required. string
Detailed location information for this Region, including city, state or region, and country.
PlacementGroupLimits This property is required. List<GetRegionsRegionPlacementGroupLimit>
Information about placement groups limits for this region.
SiteType This property is required. string
The type of this region.
Status This property is required. string
This region’s current operational status (ok or outage).
Resolvers List<GetRegionsRegionResolver>
Capabilities This property is required. []string
A list of capabilities of this region.
Country This property is required. string
The country the region resides in.
Id This property is required. string
The unique ID of this Region.
Label This property is required. string
Detailed location information for this Region, including city, state or region, and country.
PlacementGroupLimits This property is required. []GetRegionsRegionPlacementGroupLimit
Information about placement groups limits for this region.
SiteType This property is required. string
The type of this region.
Status This property is required. string
This region’s current operational status (ok or outage).
Resolvers []GetRegionsRegionResolver
capabilities This property is required. List<String>
A list of capabilities of this region.
country This property is required. String
The country the region resides in.
id This property is required. String
The unique ID of this Region.
label This property is required. String
Detailed location information for this Region, including city, state or region, and country.
placementGroupLimits This property is required. List<GetRegionsRegionPlacementGroupLimit>
Information about placement groups limits for this region.
siteType This property is required. String
The type of this region.
status This property is required. String
This region’s current operational status (ok or outage).
resolvers List<GetRegionsRegionResolver>
capabilities This property is required. string[]
A list of capabilities of this region.
country This property is required. string
The country the region resides in.
id This property is required. string
The unique ID of this Region.
label This property is required. string
Detailed location information for this Region, including city, state or region, and country.
placementGroupLimits This property is required. GetRegionsRegionPlacementGroupLimit[]
Information about placement groups limits for this region.
siteType This property is required. string
The type of this region.
status This property is required. string
This region’s current operational status (ok or outage).
resolvers GetRegionsRegionResolver[]
capabilities This property is required. Sequence[str]
A list of capabilities of this region.
country This property is required. str
The country the region resides in.
id This property is required. str
The unique ID of this Region.
label This property is required. str
Detailed location information for this Region, including city, state or region, and country.
placement_group_limits This property is required. Sequence[GetRegionsRegionPlacementGroupLimit]
Information about placement groups limits for this region.
site_type This property is required. str
The type of this region.
status This property is required. str
This region’s current operational status (ok or outage).
resolvers Sequence[GetRegionsRegionResolver]
capabilities This property is required. List<String>
A list of capabilities of this region.
country This property is required. String
The country the region resides in.
id This property is required. String
The unique ID of this Region.
label This property is required. String
Detailed location information for this Region, including city, state or region, and country.
placementGroupLimits This property is required. List<Property Map>
Information about placement groups limits for this region.
siteType This property is required. String
The type of this region.
status This property is required. String
This region’s current operational status (ok or outage).
resolvers List<Property Map>

GetRegionsRegionPlacementGroupLimit

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

GetRegionsRegionResolver

Ipv4 This property is required. string
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
Ipv6 This property is required. string
The IPv6 addresses for this region’s DNS resolvers, separated by commas.
Ipv4 This property is required. string
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
Ipv6 This property is required. string
The IPv6 addresses for this region’s DNS resolvers, separated by commas.
ipv4 This property is required. String
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
ipv6 This property is required. String
The IPv6 addresses for this region’s DNS resolvers, separated by commas.
ipv4 This property is required. string
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
ipv6 This property is required. string
The IPv6 addresses for this region’s DNS resolvers, separated by commas.
ipv4 This property is required. str
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
ipv6 This property is required. str
The IPv6 addresses for this region’s DNS resolvers, separated by commas.
ipv4 This property is required. String
The IPv4 addresses for this region’s DNS resolvers, separated by commas.
ipv6 This property is required. 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 v4.37.0 published on Thursday, Apr 10, 2025 by Pulumi