Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getRegions
Explore with Pulumi AI
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=[
{
"name": "status",
"values": ["ok"],
},
{
"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.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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
; defaultexact
)
- 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.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
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.
- Placement
Group List<GetLimits Regions Region Placement Group Limit> - Information about placement groups limits for this region.
- Site
Type string - The type of this region.
- Status string
- This region’s current operational status (ok or outage).
- Resolvers
List<Get
Regions Region Resolver>
- 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.
- Placement
Group []GetLimits Regions Region Placement Group Limit - Information about placement groups limits for this region.
- Site
Type string - The type of this region.
- Status string
- This region’s current operational status (ok or outage).
- Resolvers
[]Get
Regions Region Resolver
- 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.
- placement
Group List<GetLimits Regions Region Placement Group Limit> - Information about placement groups limits for this region.
- site
Type String - The type of this region.
- status String
- This region’s current operational status (ok or outage).
- resolvers
List<Get
Regions Region Resolver>
- 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.
- placement
Group GetLimits Regions Region Placement Group Limit[] - Information about placement groups limits for this region.
- site
Type string - The type of this region.
- status string
- This region’s current operational status (ok or outage).
- resolvers
Get
Regions Region Resolver[]
- 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_ Sequence[Getlimits Regions Region Placement Group Limit] - 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[Get
Regions Region Resolver]
- 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.
- placement
Group List<Property Map>Limits - Information about placement groups limits for this region.
- site
Type String - The type of this region.
- status String
- This region’s current operational status (ok or outage).
- resolvers List<Property Map>
GetRegionsRegionPlacementGroupLimit
- Maximum
Linodes intPer Pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- Maximum
Pgs intPer Customer - The maximum number of placement groups allowed for the current user in this region.
- Maximum
Linodes intPer Pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- Maximum
Pgs intPer Customer - The maximum number of placement groups allowed for the current user in this region.
- maximum
Linodes IntegerPer Pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- maximum
Pgs IntegerPer Customer - The maximum number of placement groups allowed for the current user in this region.
- maximum
Linodes numberPer Pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- maximum
Pgs numberPer Customer - The maximum number of placement groups allowed for the current user in this region.
- maximum_
linodes_ intper_ pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- maximum_
pgs_ intper_ customer - The maximum number of placement groups allowed for the current user in this region.
- maximum
Linodes NumberPer Pg - The maximum number of Linodes allowed to be assigned to a placement group in this region.
- maximum
Pgs NumberPer Customer - The maximum number of placement groups allowed for the current user in this region.
GetRegionsRegionResolver
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.