Show / Hide Table of Contents

Class GetRegions

Inheritance
System.Object
GetRegions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws
Assembly: Pulumi.Aws.dll
Syntax
public static class GetRegions

Methods

View Source

InvokeAsync(GetRegionsArgs, InvokeOptions)

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.

{{% examples %}}

Example Usage

{{% example %}}

Enabled AWS Regions:

using Pulumi;
using Aws = Pulumi.Aws;

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

}

All the regions regardless of the availability

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var current = Output.Create(Aws.GetRegions.InvokeAsync(new Aws.GetRegionsArgs
    {
        AllRegions = true,
    }));
}

}

To see regions that are filtered by "not-opted-in", the all_regions argument needs to be set to true or no results will be returned.

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var current = Output.Create(Aws.GetRegions.InvokeAsync(new Aws.GetRegionsArgs
    {
        AllRegions = true,
        Filters = 
        {
            new Aws.Inputs.GetRegionsFilterArgs
            {
                Name = "opt-in-status",
                Values = 
                {
                    "not-opted-in",
                },
            },
        },
    }));
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args = null, InvokeOptions options = null)
Parameters
Type Name Description
GetRegionsArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetRegionsResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.