AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.1 published on Tuesday, Jun 21, 2022 by Pulumi

getRegions

Provides information about AWS Regions. Can be used to filter regions i.e., by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the aws.getRegion data source.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Aws.GetRegions.InvokeAsync());
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aws.GetRegions(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var current = Output.of(AwsFunctions.getRegions());

    }
}
import pulumi
import pulumi_aws as aws

current = aws.get_regions()
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = pulumi.output(aws.getRegions());
variables:
  current:
    Fn::Invoke:
      Function: aws:getRegions
      Arguments: {}

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(all_regions: Optional[bool] = None,
                filters: Optional[Sequence[GetRegionsFilter]] = None,
                opts: Optional[InvokeOptions] = None) -> GetRegionsResult
def get_regions_output(all_regions: Optional[pulumi.Input[bool]] = None,
                filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetRegionsFilterArgs]]]] = 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: aws:index/getRegions:getRegions
  Arguments:
    # Arguments dictionary

The following arguments are supported:

AllRegions bool

If true the source will query all regions regardless of availability.

Filters List<GetRegionsFilter>

Configuration block(s) to use as filters. Detailed below.

AllRegions bool

If true the source will query all regions regardless of availability.

Filters []GetRegionsFilter

Configuration block(s) to use as filters. Detailed below.

allRegions Boolean

If true the source will query all regions regardless of availability.

filters List<GetRegionsFilter>

Configuration block(s) to use as filters. Detailed below.

allRegions boolean

If true the source will query all regions regardless of availability.

filters GetRegionsFilter[]

Configuration block(s) to use as filters. Detailed below.

all_regions bool

If true the source will query all regions regardless of availability.

filters Sequence[GetRegionsFilter]

Configuration block(s) to use as filters. Detailed below.

allRegions Boolean

If true the source will query all regions regardless of availability.

filters List<Property Map>

Configuration block(s) to use as filters. Detailed below.

getRegions Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

Names of regions that meets the criteria.

AllRegions bool
Filters List<GetRegionsFilter>
Id string

The provider-assigned unique ID for this managed resource.

Names []string

Names of regions that meets the criteria.

AllRegions bool
Filters []GetRegionsFilter
id String

The provider-assigned unique ID for this managed resource.

names List<String>

Names of regions that meets the criteria.

allRegions Boolean
filters List<GetRegionsFilter>
id string

The provider-assigned unique ID for this managed resource.

names string[]

Names of regions that meets the criteria.

allRegions boolean
filters GetRegionsFilter[]
id str

The provider-assigned unique ID for this managed resource.

names Sequence[str]

Names of regions that meets the criteria.

all_regions bool
filters Sequence[GetRegionsFilter]
id String

The provider-assigned unique ID for this managed resource.

names List<String>

Names of regions that meets the criteria.

allRegions Boolean
filters List<Property Map>

Supporting Types

GetRegionsFilter

Name string

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

Values List<string>

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Name string

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

Values []string

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name String

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

values List<String>

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name string

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

values string[]

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name str

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

values Sequence[str]

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name String

The name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1].

values List<String>

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.